Forum
00:49
23/08/2013
Hi,
i am new to jqgrid and after searching out for lot of examples, i got a grid loading and working fine. I have the edit button in the navGrid. when i select a row and click edit, the edit dialog is popping up.
but i want to control this action. i want the edit dialog to show up only when some condition meets. condition can be like a variable being set in database or javascript.
is it possible?
my code is like below
..}).jqGrid('navGrid','#pager',{},editSettings,addSettings,delSettings,…
editSettings = {
onclickSubmit:onclickSubmitLocal closeAfterEdit:true, savekey: [true,13], closeOnEscape:true, reloadAfterSubmit:false, jqModal:false,
}
basically i have two buttons on my page - "Lock for edit" and "unlock". if the user wants to make any change, they shd first lock the table, so that it is visible to others in read only mode. so without clicking "lock for edit" button, they shd not be able to edit or delete the rows. how do i do it?
please help.
Thanks.
01:44
23/08/2013
fixed this by using below code
var grid = $("#list"); var gid = $.jgrid.jqID(grid[0].id); var $td; if (isLocked == false) { $td = $('#add_' + gid); $td.hide(); $td = $('#edit_' + gid); $td.hide(); $td = $('#del_' + gid); $td.hide(); //$('#pager_left').attr({ style: ["display:none"] }) } else { $td = $('#add_' + gid); $td.show(); $td = $('#edit_' + gid); $td.show(); $td = $('#del_' + gid); $td.show(); //$('#pager_left').attr({ style: ["display:inline"].join(' ') }) }
11:56
Moderators
30/10/2007
Hello,
Why so complex? There is a very elegant solution if you use beforeInitData event. You will need just to look at /jqgridwiki/doku.php?id=wiki:form_editing&s[]=beforeinitdata
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
30 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66