javascript - ShieldUI Grid - show dropdown on insert only -
i'm using shieldui grid, , have new row on grid show dropdown in 1 of columns. column not editable , displays text. want user able select value dropdown, not editable after being added. i've reviewed documentation multiple times, , can't seem figure out.
$(document).ready(function() { $("#propertiesgrid").shieldgrid({ theme: "light-bootstrap", datasource: { remote: { read: { url: "/api" + window.location.pathname + "/productattributes", datatype: "json" } }, modify: { update: function(items, success, error) { $.ajax({ type: "put", url: "/api" + window.location.pathname + "/productattributes", datatype: "json", contenttype: "application/json", data: json.stringify(items[0].data) }).then(success, error); } } }, schema: { fields: { "attributeid": { path: "attributeid" }, "productattributeid": { path: "productattributeid" }, "productid": { path: "productid" }, "attributename": { path: "attributename" }, "minimum": { path: "minimum" }, "target": { path: "target" }, "maximum": { path: "maximum" }, "method": { path: "method" } } }, rowhover: false, resizing: true, scrolling: true, events: { insert: function() { addnewrow() } }, editing: { enabled: true, type: "row", insertnewrowat: "pagebottom" }, toolbar: [ { buttons: [ { commandname: "insert", caption: "add product" } ], position: "bottom" } ], paging: { pagesize: 10, pagelinkscount: 12, messages: { infobartemplate: "from {0} {1} items of total of {2}", firsttooltip: "first page", previoustooltip: "previous page", nexttooltip: "next page", lasttooltip: "last page" } }, columns: [ { field: "attributename", title: "attribute", editable: false, id: "attributename" }, { field: "minimum", title: "minimum" }, { field: "target", title: "target" }, { field: "maximum", title: "maximum" }, { field: "method", title: "method" }, { width: 150, title: " ", buttons: [ { commandname: "edit", caption: "edit" }, { commandname: "delete", caption: "delete" } ] } ] }); });
there workaround. leave column editable, bind on edit event thrown grid, find editor column , hide or replace value of cell.
events: { edit: function(e) { var target = $("#column_editor_id"); target.hide(); } },
Comments
Post a Comment