shieldui - How to trigger an event when shield-ui grid cell text box destroyed -
as mentioned in question title need trigger event shield-ui grid editable cell textbox destroyed. couldnt find solution in documentation.any appreciable. thank you.
here code far ...
$("#alltransgrid").shieldgrid({ datasource: { data: datad, schema: { fields: { mbr_id: {path: "mbr_id", type: string}, lon_id: {path: "lon_id", type: string}, center_name: {path: "center_name", type: string}, grp_name: {path: "grp_name", type: string}, mbr_name: {path: "mbr_name", type: string}, lon_amt: {path: "lon_amt", type: number}, lon_int_amt: {path: "lon_int_amt", type: number}, loan_total: {path: "loan_total", type: number}, ind_inst: {path: "ind_inst", type: number}, today_pay: {path: "today_pay", type: number, nullable: false}, lon_id_as: {path: "lon_id_as", type: number} } } }, sorting: { multiple: true }, paging: { pagesize: 12, pagelinkscount: 10 }, selection: { type: "row", multiple: true, toggle: false }, columns: [ {field: "mbr_id", width: "100px", title: "member id"}, {field: "lon_id", width: "100px", title: "loan id"}, {field: "center_name", title: "center name", width: "100px"}, {field: "grp_name", title: "group name", width: "70px"}, {field: "mbr_name", title: "member name", width: "170px"}, {field: "lon_amt", title: "loan amount", width: "100px"}, {field: "lon_int_amt", title: "interest", width: "100px"}, {field: "loan_total", title: "total", width: "80px"}, {field: "ind_inst", title: "installment amount", width: "120px"}, {field: "today_pay", title: "today payment"} ], events: { editorcreating: function (e) { if (e.field == "ind_inst") { e.options = {enabled: false, max: 1000}; } if (e.field == "loan_total") { e.options = {enabled: false, max: 500000}; } if (e.field == "lon_int_amt") { e.options = {enabled: false, max: 100000}; } if (e.field == "lon_amt") { e.options = {enabled: false, max: 100000}; } if (e.field == "mbr_name") { e.options = {enabled: false}; } if (e.field == "grp_name") { e.options = {enabled: false}; } if (e.field == "center_name") { e.options = {enabled: false}; } if (e.field == "lon_id") { e.options = {enabled: false}; } if (e.field == "mbr_id") { e.options = {enabled: false}; } if (e.field == "today_pay") { e.options = {max: 10000}; } }, detailcreated: function (e) { $.ajax({ url: "paymentcatchergroupby", cache: false, datatype: 'json', data: {loan_id: e.item.lon_id_as, c_id: center_id}, success: function (data) { $("<div/>") .appendto(e.detailcell) .shieldgrid({ datasource: {data: data}, sorting: { multiple: true }, paging: { pagesize: 5 }, columns: [ {field: "installment_num", title: "week", editable: false}, {field: "installmentamount", title: "installment amount", editable: false}, {field: "paidamount", title: "paid amount", editable: false}, {field: "duedate", title: "date paid", type: date, editable: false} ], editing: {enabled: false} }); }, error: function (jqxhr, textstatus, errorthrown) { alert('error'); } }); }, command: function (e) { //selectionchanged doesnt work here.... if (e.commandname == "selectionchanged") { var tobeselected = e.tobeselected; console.log(tobeselected); // e.cancel = true; } } }, editing: { enabled: true, event: "doubleclick", type: "cell" }, scrolling: true, height: 600 });
after focus lost of textbox need trigger event :
there no destroy event, associated of editors in control, when in edit mode. 1 option, depending on final goal have subscribe command event: http://www.shieldui.com/documentation/grid/javascript/api/events/command should triggered on save, after edit. if not option, please supply additional information on exact end result after.
Comments
Post a Comment