Hi, I started working on JQGR, and it works well for adding, searching and for everyone, but when I want to get the record as my post says to me error, but if I do not enter it to remove and edit the controller action myself, I checked it with a brake point there. My code looks like {{/ p>
& lt; Table id = "jQGridDemo" & gt; & Lt; / Table & gt; & Lt; Div id = "jQGridDemoPager" & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; JQuery ("# jQGridDemo"). JquGrid ([url: 'RTGser / GetUserDetails', datatype: "Jason", colNames: ['Id', 'name', 'designation', 'city'], colomodel: [{name: 'name', 'name' Align: 'name', width: 40, align: 'id', index: 'id', width: 40, align: 'center', sorted: true, editable: false}, {name: 'name {Name: 'Designation', Index: 'Designation', Width: 400, Line: 'Center', 'Center', Sorted: Correct, Editable: True, Editing: 'Text', Editorial: {Required: True}}, , Sorted: true, editable: true, edittype: 'text', editrule S: {Required: true}}, {name: 'city', index: 'city', width: 150, align: 'center', sorted: right, editable: [5, 10, 20, 30] Pager: 'id', viewer: true, sor Torder: '# jQGridDemoPager', sort name: true, edittype: 'text', editrules: {required: true}}], MTIP: 'POST', to load: 'Desc', caption: "user list"}); JQuery ("# jQGridDemo"). JqGrid ('navgrid', '#jQGridDemoPager', {edit: true, add: true, del: true, search: true}, {url: "/ RTGUser / EditUser", closeAfterEdit: true, (Showid) $ ("# Id", formid) .hide ();}}, {url: "/ RTGUser / addNewUser", closeAfterAdd: true, beforeShowForm: function {formid} {$ ("# id", formid) .hide ( );}}, {Url: "/ RTGUser / DeleteUser"}, {}); $ ("#search"). Filter grid ("# grid", {grid model: wrong, filter model: [[label: 'search', name: 'search', stip: 'text'}]}); & Lt; / Script & gt; & Lt; / Body & gt;
}
and looks like my controller {
Public user editing user (int user id, string name, string Desig, string city) {try {var query = u to db.Users where u.Id.Equals (userId) select; Var user = query.First (); User.Name = Name; User.Designation = desig; User.City = City; Db.SaveChanges (); Return Jason (true); } Hold (exception) {// some error logging content, handling exceptions etc. Back Jason (wrong); }} Public Action Result Delete User (from user ID) (DB user in URL from {var query =} Select UID.quality (userID) u; // var user = query.First (); var usr = db Finders (convert.tooinnt32 (userId); db.Users.Remove (usr); db.SaveChanges (); return Jason (true);} hold (exception e) {// some error logging content, handle exception (E); Return Jason (false); please}} P> Use Firefox / Firebug or IE8 Developer Tools so that you can Micro actual response getting from the server. It falls on what line? Once you've searched, you will probably find your error.
Comments
Post a Comment