Editor fields options& select datasource
Editor fields options& select datasource
Thank you for come here,
I have two questions:
First is while define the fields options of editor,like this
"fields": [
{
label: "businessName:",
name: "businessName"
}, {
label: "customName:",
name: "customName"
}
can I set one field invisible but also can be submit to server,
another one is can we use the remote dynamic data as the select options but not define in initialization
{
label: "type:",
name: "type",
type:"select",
options: [
{ label: "B2B", value: 1 },
{ label: "B2C", value: 2 },
{ label: "C2C", value: 3 },
{ label: "UED", value: 4 }
]
}
Is that feasible to use the data from ajax request as the options data
$.ajax{
var custom;
$.ajax({
url: '/business/add',
success:function(data){
custom=data;
}
});
}
type:"select",
options:custom
I return json to the ajax request but it doesn't work what should I modify
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Answers
Use
hidden
.Yes - use the
update
method of theselect
field type to update the information in the list from your Ajax request.Allan