I've the same problem.
Now I use the jquery contextmenu, but I don't know how to change the menu items according to the row content.
Can anyone help me?
I've found the setting of reloadAfterSubmit.
Thanks.
I've found the setting: reloadAfterSubmit.
Thanks.
You can define an event (onchange?) in editoptions of the first column (first list) to change the second list. Hope it helps.
for example:
I checked the source code of the example case and find that:
jQuery('#grid').jqGrid('navGrid','#pager',{“edit”:false,”add”:false,”del”:false,”search”:true,”refresh”:true,”view”:false,”excel”:true},{“drag”:true,”resize”:true,”closeOnEscape”:true,”dataheight”:150,”mtype”:”POST”},{“drag”:true,”resize”:true,”closeOnEscape”:true,”dataheight”:150,”mtype”:”POST”},
{“mtype”:”POST”},
{“drag”:true,”closeAfterSearch”:true,”multipleSearch”:true},{“drag”:true,”resize”:true,”closeOnEscape”:true,”dataheight”:150});
jQuery('#grid').jqGrid('navButtonAdd','#pager',{caption:'',title:'Export to Excel',onClickButton : function(e){
try {
jQuery(“#grid”).jqGrid('excelExport',{url:'grid.php'});
} catch (e) {
window.location= 'grid.php?oper=excel';
}
}});
Tony,
I'm sorry for my poor english.
Yes, we can launch the form by condition, but if i create my own form, i have to code for input valid checking, right? I think it's very convinient to set the formatter for cells (such as integer, email and custom formatter and which will trigger the front-end checking when submitted). And we just need a form to edit/new/view, but don't care the form is inline created or extern assigned (just assign a formId or form defined filename, I think assign a form defined file name will be better). All settings in colmodels, such as formatter should work without re-coding. That's why I want to increase parameter(s) in Grid to assign the formId(s), I think it can simplize the coding.
Thanks.
In fact, I want to add the custom form like the following way:
Add a new parameter for custom form (maybe more than one parameter, if consider the new form, edit form and view form), if there's no custom form assigned, create the default form, otherwise, use the custom form. Fill the custom form/defaut form with the rowdata and all settings in colmodels should work in default form or custom form.
Is it possible?
It seems there's an option for grid:
ajaxSelectOptions /jqgridwiki/doku.php?id=wiki:options
You can try to set it to {type:'POST'}.
Maybe helpful.
Tony,
Thank you very much. I found a similar article:/blog/?page_id=393/discussion/selecting-row
I tried the onCellSelect Event, yes, it's almost good enough. But there's no underline to tell the user that it can be clicked and I hope that only when the user click the text, the edit or view form pop up.
Now I add a link after gridComplete event like “aaaa” for I can not get the rowId in custom format parameters. If I can get the gridId, I can do it with a custom formatter. How can I get the gridId just with jqgrid method?
I'm a fool!!
I can get the gridid:
|
1 |
<span class="pln">gridId </span><span class="pun">=</span><span class="pln"> $</span><span class="pun">(</span><span class="kwd">this</span><span class="pun">).</span><span class="pln">attr</span><span class="pun">(</span><span class="str">'id'</span><span class="pun">);<br /><br />right?<br /><br />I'm wrong. in the custom formatter function, I can not get $(this).:(<br /><br /><br /></span> |
Can we put the gridId in the opt in formatter function? I looked the source code, it seems I can do it in formatter function in grid.base.js, about line 394.
Thank you again.
I need the feature too.
I'm suggested to use the onCellSelect event to popup a form, yes, it almost good enough. but I still like a link.
There's another way: using a custom formatter ( I don't think link format can cover it) to transfer the content to a link, just like:
But I can not get the gridid in custom formatter function. /jqgridwiki/doku.php?id=wiki:custom_formatter
If jqgrid can save the gridid in its options, it will be very helpful.
My poor english:(.
I met the same problem.
Tony,
Sometimes we want to link to a javascript function, such as I met before: I want to edit the current row when I click a cell. It seems can not done by the link or showlink formatter.
Regards.
Tony,
I improved the function serialize2Str to get the function name from function handle. So I think the code can work now. but I don't think it's a good solution. I still suggest to modify the jqgrid code to improve the event handle(if
I should explain the environment of my application. PHP + mySql + jQuery.
I want to use only one list.php to display all grid. the grid definition will be defined in other .php files. The list.php get the grid name from $_REQUEST then gets the grid definition with ajax and display it. Different grid has different options. So I have to pass some parameters to the grid definition. For example, for users management, when edit a user, we should disable the account, but when add a new user, we must enable the account. This action is done in beforeShowForm. But for other grid, there's no such problem. So I have to set the editOptions and some other options as parameters to pass to the list.php.
Tony,
Thank you very much.
I want to add a link to a field to edit the row. I used the following code:
var disableAccount = function(formid){
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top