Hi.
I have a datatable and one of the columns is a combo/richselect.
How can i make the options in the select be data from a var or ajax result.
Kind Regards
Hello,
Here is an example of how to load options by providing the URL in the options/collection
property of the column: https://snippet.webix.com/75629f57
And an example with options stored in a variable: https://snippet.webix.com/7ardx6a6
you have typo
use collection
, not selection
Aaaa, thank you
Hi. I’m running into a problem on this. So i get the var one to work. However, if i populate the var with data from ajax like below then it’s not working.
var getsdata= webix.ajax().get(“shifts”, popup , function(text){
myvar = text;
});
did you try {options:"/path/to/your/shifts"}
?
Yes, however this is a servlet with post function hence Ajax
If you just want to send a POST request ( without parameters), you can use
the related proxy:
{ options:"post->shifts"}
If you need to send parameters, the solution is as follows:
webix.ajax().post(url, params, function(text, data){
grid.getColumnConfig(columnId).options = data.json();
grid.refreshColumns();
});
Thank you, that works