Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
69f0e5be
Commit
69f0e5be
authored
Feb 06, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2329 from tonydspaniard/1094-modal-generator-autocomplete-fix
1904 modal generator autocomplete fix
parents
d438913e
333630ae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
CHANGELOG.md
extensions/gii/CHANGELOG.md
+1
-0
gii.js
extensions/gii/assets/gii.js
+9
-0
typeahead.js
extensions/gii/assets/typeahead.js
+0
-0
ActiveField.php
extensions/gii/components/ActiveField.php
+4
-1
No files found.
extensions/gii/CHANGELOG.md
View file @
69f0e5be
...
@@ -5,6 +5,7 @@ Yii Framework 2 gii extension Change Log
...
@@ -5,6 +5,7 @@ Yii Framework 2 gii extension Change Log
----------------------------
----------------------------
-
Bug #1405: fixed disambiguation of relation names generated by gii (qiangxue)
-
Bug #1405: fixed disambiguation of relation names generated by gii (qiangxue)
-
Bug #1904: Fixed autocomplete to work with underscore inputs "_" (tonydspaniard)
-
Bug #2298: Fixed the bug that Gii controller generator did not allow digit in the controller ID (qiangxue)
-
Bug #2298: Fixed the bug that Gii controller generator did not allow digit in the controller ID (qiangxue)
-
Bug: fixed controller in crud template to avoid returning query in findModel() (cebe)
-
Bug: fixed controller in crud template to avoid returning query in findModel() (cebe)
-
Enh #1624: generate rules for unique indexes (lucianobaraglia)
-
Enh #1624: generate rules for unique indexes (lucianobaraglia)
...
...
extensions/gii/assets/gii.js
View file @
69f0e5be
...
@@ -71,6 +71,15 @@ yii.gii = (function ($) {
...
@@ -71,6 +71,15 @@ yii.gii = (function ($) {
};
};
return
{
return
{
autocomplete
:
function
(
counter
,
data
)
{
var
datum
=
new
Bloodhound
({
datumTokenizer
:
function
(
d
){
return
Bloodhound
.
tokenizers
.
whitespace
(
d
.
word
);},
queryTokenizer
:
Bloodhound
.
tokenizers
.
whitespace
,
local
:
data
});
datum
.
initialize
();
jQuery
(
'.typeahead-'
+
counter
).
typeahead
(
null
,{
displayKey
:
'word'
,
source
:
datum
.
ttAdapter
()});
},
init
:
function
()
{
init
:
function
()
{
initHintBlocks
();
initHintBlocks
();
initStickyInputs
();
initStickyInputs
();
...
...
extensions/gii/assets/typeahead.js
View file @
69f0e5be
This diff is collapsed.
Click to expand it.
extensions/gii/components/ActiveField.php
View file @
69f0e5be
...
@@ -63,7 +63,10 @@ class ActiveField extends \yii\widgets\ActiveField
...
@@ -63,7 +63,10 @@ class ActiveField extends \yii\widgets\ActiveField
{
{
static
$counter
=
0
;
static
$counter
=
0
;
$this
->
inputOptions
[
'class'
]
.=
' typeahead-'
.
(
++
$counter
);
$this
->
inputOptions
[
'class'
]
.=
' typeahead-'
.
(
++
$counter
);
$this
->
form
->
getView
()
->
registerJs
(
"jQuery('.typeahead-
{
$counter
}
').typeahead({local: "
.
Json
::
encode
(
$data
)
.
"});"
);
foreach
(
$data
as
&
$item
)
{
$item
=
array
(
'word'
=>
$item
);
}
$this
->
form
->
getView
()
->
registerJs
(
"yii.gii.autocomplete(
$counter
, "
.
Json
::
encode
(
$data
)
.
");"
);
return
$this
;
return
$this
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment