未经测试,但应该可以工作:
$('.e6').on("change", function(e){ if (e.removed) { $.ajax({ type: "POST", url: '/admin/?controller=vouchers&action=updateRelatedProducts', data: {id: e.removed.id, action: remove}, //Or you can e.removed.text error: function () { alert("error"); } }); } if (e.added) { $.ajax({ type: "POST", url: '/admin/?controller=vouchers&action=updateRelatedProducts', data: {id: e.added.id, action: add}, //Or you can e.added.text error: function () { alert("error"); } }); } //OR you can play with val data instead if (e.val) { $.ajax({ type: "POST", url: '/admin/?controller=vouchers&action=updateRelatedProducts', data: {val: JSON.stringify(e.val)}, //Will send all the selected values error: function () { alert("error"); } }); }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)