Panel dropdown list?
Panel dropdown list?
Hey
I have a problem when i use function createPanel.
All Input type (data-editor-field) field works great, but select list not working on Panel?
I use this code editing my own program..
https://editor.datatables.net/examples/standalone/collection.html
Row
'<dd data-editor-field="customer.treatment_id">'+data.customer.treatment_id+'</dd>'+
and
editor = new $.fn.dataTable.Editor( {
ajax: "js_customer.php",
fields: [ {
label: "Treatment:",
name: "customer.treatment_id",
type: "select"
}.......
This same code work if i use normal datatable, not not as use Panel.
Answers
One more situation.
If i use, static options it's works.
options: [
{ label: "Status1", value: "1" },
{ label: "Status0", value: "0" },
]
But my options is relation mysql, not works
Field::inst( 'customer.treatment_id' )
->options( Options::inst()
->table( 'customer_treatment' )
->value( 'id' )
->label( 'treatment' )
),
Right - when you are using DataTables, then Editor can automatically listen for the
xhr
event and check to see if there are any options for its list fields. Since you aren't using DataTables there is no Ajax request that Editor can automatically listen to, so there is no way for it to populate the options.Two options:
editor.field('customer.treatment_id').update( ...options... );
, orAllan
Thanks, my knowledge for Ajax and JavaScript is not enough to do this.
So i find some examples.