datatables with jeditable plugin - sorting dropdown list
datatables with jeditable plugin - sorting dropdown list
Hello
Sorry for this but I couldn't find answer on forum.
I'm using datatables (1.9.3) with jeditable plugin.
Drop down list in table is defined with:
[code]
{
tooltip: 'Click to select',
loadtext: 'loading...',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'link.php?action=getList',
loadtype: 'GET',
sUpdateURL: "link.php?action=quickEdit"
}
[/code]
The php sends back id and name columns sorted by name (I wanted this way)
{'236':'AAA','228':'BBBB','155':'CCC','156':'DDD','120':'EEE','12':'MMMM'}
but in drop down list I have sorted by id, ascending.
MMMM
EEE
CCC
DDD
BBBB
AAA
which isn't usable when you have many options
Does anyone has any clue why this happens and which script does resorting ?
Sorry for this but I couldn't find answer on forum.
I'm using datatables (1.9.3) with jeditable plugin.
Drop down list in table is defined with:
[code]
{
tooltip: 'Click to select',
loadtext: 'loading...',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'link.php?action=getList',
loadtype: 'GET',
sUpdateURL: "link.php?action=quickEdit"
}
[/code]
The php sends back id and name columns sorted by name (I wanted this way)
{'236':'AAA','228':'BBBB','155':'CCC','156':'DDD','120':'EEE','12':'MMMM'}
but in drop down list I have sorted by id, ascending.
MMMM
EEE
CCC
DDD
BBBB
AAA
which isn't usable when you have many options
Does anyone has any clue why this happens and which script does resorting ?
This discussion has been closed.
Replies
The solution is to echo JSON in next format
{'_236':'AAA','_228':'BBBB','_155':'CCC','_156':'DDD','_120':'EEE','_12':'MMMM'}
Of course, the _ char can be replaced with any other non number char. The goal is to avoid integer keys.