Create a plugin for the datatable editor?
Create a plugin for the datatable editor?
Hello Allan, could you describe me how I can do to get an object inside another object to insert into the select type field, I do not want it to make logic, I do not want it to give me the script, I need to know for ex:
First step: In the editor I call a function listObject () - > {name: "minhasContas.nome", placeholder: 'Contas', "type": "select", "options": listObject() },
Second step: in the function I create a list - >
function listObject() {
var list = new Array();
list.push(["Item 1"]);
list.push(["Item 2"]);
list.push(["Item 3"]);
};
Third step: In the function I create an object that loads by ajax the list that I need inside the select type field.
Is this order to create a plugin for the datatable editor?
This question has an accepted answers - jump to answer
Answers
Could you explain to me a little about how you want to use this - ideally with screenshots of what you want? I don't really understand the point about using an array inside the array of options or what the goal there is. Why would you want to use an inner array?
Allan
My goal was this:
`function listMinhasContas(){
and in the editor:
{ name: "minhasContas.nome",
placeholder: 'Contas', "type": "select", "ipOpts": listMinhasContas()
},
I need to load my my a list of objects that is inside my json that loads on the table
That looks more like it to me. Use
editor.field('minhasContas.nome').update( ... );
to update the list of options.Allan
Do you have an example? Do you have an example? I do not know how to implement!
The
select
field has some example code showing howupdate()
can be used.Its basically what I showed above - you give
field()
the field name you want to update the options of andupdate()
the list of options.Allan