Hi Alan, here's my javascript: ···editor1.on('preOpen', function (e) { e.preventDefault();
$.ajax({
url: '/api/boss/vipCredit',
data: {id:table.row( '.selected' ).data().sc_channel_credits.channelId},
success:function(data) {
console.log(data);
editor1.add({
label: "会员卡信息:",
name: "sc_org_vips[].name",
type: "checkbox",
options:data
});
}
});
});
··· and here's the ajax data format: [{"id":1,"name":"vip1"}]
When I tried to launch it , there's some error occured. Would you please tell me how to insert the checkbox value by the option method or there's a correct method to add it?
One more question, due to the ajax delay, which event should I insert the ajax to add the checkbox before the editor opened?