Как обновить сетку jquery
<script> $(function () { $.ajax({ type: "GET", url: "/Test/GetMerchant" }).done(function (data) { //$("#leftMenu").hide(); var MyDateField = function (config) { jsGrid.Field.call(this, config); }; MyDateField.prototype = new jsGrid.Field({ sorter: function (date1, date2) { return new Date(date1) - new Date(date2); }, itemTemplate: function (value) { //debugger if (value == "") return ""; else { var date = new Date(value).toDateString() //var date = new Date(value).toDateString("MM/dd/yyyy") //return new Date(value).toDateString(); //return value; var d = new Date(date), month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = '0' + month; if (day.length < 2) day = '0' + day; var df = [month, day, year].join('/'); date = df; return date; } }, insertTemplate: function (value) { //debugger return this._insertPicker = $("<input>").datepicker({ defaultDate: new Date() }); }, editTemplate: function (value) { //debugger return this._editPicker = $("<input>").datepicker({ dateFormat: "MM/dd/yyyy" }).datepicker("setDate", new Date(value)); }, insertValue: function () { // debugger if (this._insertPicker.datepicker("getDate") != null) return this._insertPicker.datepicker("getDate"); //.toISOString("MM/dd/yyyy") else return this._insertPicker.datepicker("getDate"); }, editValue: function () { //debugger if (this._editPicker.datepicker("getDate") != null) { //.toISOString("MM/dd/yyyy") return this._editPicker.datepicker("getDate"); } //return this._editPicker.datepicker("getDate").toISOString(); else return this._editPicker.datepicker("getDate"); } }); jsGrid.fields.myDateField = MyDateField; $("#jsGrid").jsGrid({ height: "50%", width: "100%", filtering: true, editing: true, inserting: true, sorting: true, paging: true, autoload: true, pageSize: 12, pageButtonCount: 5, //pageLoading: true, deleteConfirm: "Do you really want to delete the merchandise?", controller: db, fields: [ { type: "control" }, { name: "Source", type: "text", width: 120, title: "Vendor" }, { name: "Description", type: "text", width: 210, validate: { message: "Description is required!", validator: function (value) { return value != ""; } } }, { name: "ModelNumber", type: "text", width: 120, title: "Model#/Item" }, { name: "SKU", type: "text", width: 90 }, { name: "SKU2", type: "text", width: 90 }, { name: "Comments", type: "text", width: 200 }, { name: "strReceiveDate", type: "myDateField", width: 80, align: "center", title: "Received" }, { name: "Location", type: "select", items: data.loc, valueField: "LocationID", textField: "Description", width: 100 }, { name: "Barcode", width: 80 }, { name: "BarcodePrinted", type: "checkbox", title: "Barcode Printed", sorting: false }, { name: "strLastUpdatedDate", type: "myDateField", width: 80, title: "Last Updated" }, { name: "DamageCode", type: "select", items: data.dam, valueField: "CodeID", textField: "CodeValue", title: "Damage" }, { name: "strCreatedDate", editable: false, width: 80, title: "Created Date", type: "myDateField" }, { name: "strShipDate", type: "myDateField", myCustomProperty: "bar", width: 80, title: "Ship Date" }, { name: "strConsumeDate", type: "myDateField", myCustomProperty: "bar", width: 80, title: "Consume Date" }, { name: "PendingShipment", type: "checkbox", title: "Pending", sorting: false, width: 60 }, { name: "Donated", type: "checkbox", title: "Is Donated", sorting: false, width: 60 }, { name: "ReturnRequested", type: "checkbox", title: "Return Requested", sorting: false }, { name: "ReturnTo", type: "text", width: 150, title: "Return To" }, { name: "Quantity", type: "number", width: 50, title: "Qty" }, { name: "GroupName", type: "text", width: 150, title: "Group Name" }, { name: "CustomerID", width: 100, title: "Customer ID" }, ], }); }); }); </script>
Что я уже пробовал:
я понятия не имею,как обновить сетку здесь внутренняя вставка, обновление и удаление вызова функции, и я показываю в контроллере, но я не понимаю. так что пожалуйста помогите мне это срочно