I have one scenario in which I want to apply both form editing and inline editing for same jqgrid. I have two users for example one id Admin and other is user and company is a jqgrid. now I want to apply form editing for Admin and inline editing for User for company Jqgrid. I am using JSP scriptlets for specify whether it is Admin or User.
Is anyone knows how can I able to implement this please?
@updated :
onSelectRow: function(id){
var userType='<%=userDetails[1]%>';
alert("userType= " + userType);
if(userType === 'Company Administrator'){
jQuery('#companyList').jqGrid('editRow',id,true,inlineEditSuccess);
}
}
The implementation seems me clear. You need just set on the server side a JavaScript variable which will describe which editing mode the user can use. You can even allow some user editing and another not.
If you not want to allow any kind of form editing for some use you can test the value of the corresponding variable and call
navGriddepend on the value:or you can use
If you would use the trick described in the answer (see the demo) you can call ‘navGrid’ and create all navigator buttons, but make only selected buttons visible depend on the user’s permissions.
In case of usage of inline editing you can use something like
The initializing of the
myvariable can be different depend on the technology which you use on the server side. In the simplest themyvariable can be define as global on the page so it can be defined on the top level. In case of ASP.NET MVC the code can look like the following: