How to show a column in the grid and hide it in the view dialog - jqgrid

I've used the information on this link to add a button to my grid and it works great. But I don't want that button to be displayed if the user opens that row in the view dialog. How can I hide this item in the view dialog?
I know that I can hide a column in the grid and then display it in the view dialog by using this syntax in the column definition:
, hidden: true, editrules: { edithidden: true },
But I see no way of reversing these options. I've played with different combinations of the above options, and the hidedlg option, but have had no luck.
To clarify, we are using the free version of jqGrid.

You wrote about "the view dialog" in the title of your question. Do you really mean View dialog or Edit dialog? View Dialog will be shown if you click on "View" button of navigator bar, but the button exists only if view: true option is used in navGrid. In the case you can use viewable: false property in the column.
If you want to hide the column in Edit dialog, then you can use editable: "hidden" property in the column (see the wiki article). The demo https://jsfiddle.net/OlegKi/ho803dvq/ uses properties
viewable: false, editable: "hidden"
in the last note column. The column will be shown in the grid, but the column is not visible in either View or Edit dialog.

If you use Guriddo jqGrid you can use the option viewable in colModel. Set this option to false in order to show the field in grid, but not in view form.
See the documentation for this here

Related

how to highlight only cell when click on jqgrid grid

I have jqgrid in which cells are created by java as a hyperlink, attached the image for the same.enter image description here
I want to highlight that particulate cell when i click on any count on that jqgrid.
Please refer image for the same.
jqGrid supports cell editing, which can be activated by adding the option cellEdit: true. It's important that it allows to edit content of not every columns, but the columns, which have editable: true property. If the column don't have editable: true property the the cell will be highlighted. Thus if you don'u use currently editing feature in the grid and you don't have editable: true property in any columns of colModel then adding cellEdit: true option of jqGrid should solve your problem.

kendo grid frozen navigation

I've a kendo grid with Navigatable option, and the grid navigation is working fine when I press Tab. But when I make some columns in grid as locked (frozen columns), the grid navigation is not working as expected. The navigation is working for only frozen columns and then for unfrozen columns.
#(Html.Kendo().Grid<ProcessModel>()
...
.Navigatable())
dojo.telerik.com/#joeTopazz/ODEbA
Thanks in Advance.
When the Grid has its keyboard navigation enabled, tabbing inside the widget is managed only when incell editing is used. In your example with inline editing, tabbing is managed by the browser and the observed behavior is expected due to the separate tables used for the locked and unlocked columns.
To achieve the desired tabbing order, use incell editing, or set a tabindex for all buttons and inputs from the edit row in the Grid's edit event:
http://dojo.telerik.com/EVuNe
$("#grid").kendoGrid({
navigatable: true,
editable: "inline",
edit: function(e){
e.sender.wrapper
.find(".k-grid-edit-row input,.k-grid-edit-row a")
.attr("tabindex", 1);
}
});

jqGrid edit modal AJAX?

I have a table with data, which is taken from the server. The table shows only two column. But to edit the data I will have other columns. In other words, I need to change colmodel on edit modal window? How can I do that?
I use free jqGrid last version. I found example navGrid.
Simple
How get from server (AJAX) other columns for edit?
You can specify
editrules: { edithidden: true }
additionally to hidden: true in the columns which you want to allow to edit.
For example the demo have hidden column tax which can be editing using form editing. You can start editing in the demo in three ways: double-click on the row, click on the edit button in the row and selection of the row and then click on the edit button in the navigator bar of the pager.

Is there a way to move match-rule dropdown and "+" button to the right/bottom of Searching Dialog in jqGrid version 4.5.0?

I'm using jqGrid verison 4.5.0 and I noticed by default, the pop-up single field search dialog doesn't look like this:
Is there a way to move "+" button to the right of "-" button and move match-rule dropdown to the bottom, both of them to look like this snapshot? We like it this way as it is less messy to some of our customers.
Many thanks..
JQuery v2.0
JQuery-UI v1.10.3
jqGRID v4.5.0
$('#Spreadsheet').navGrid('#Pager',
{edit:false,add:false,del:false,search:true,view:false,refresh:false},
{}, {}, {},
{multipleSearch:true,multipleGroup:true,closeOnEscape:true,closeAfterSearch:true,
searchOnEnter:true,showQuery:false,width:800,caption:"Search Records"
},
{}
After some discussion in the comment we clarified that the The searching dialog are used with options multipleSearch: true, but without multipleGroup: true. The goal is the hiding of the dropdown which allows the user to choose between "All/Any".
In the answer I showed how one can use afterRedraw to change Searching Dialog.
The demo displays the dialog in the form
It uses the following afterRedraw
afterRedraw: function () {
$("input.add-rule", this)
.button() // use jQuery UI button
.val("Add rule"); // change text of "+" button
$("input.delete-rule", this).button(); // use jQuery UI button
$("select.opsel", this).hide();
}
Only the last line ($("select.opsel", this).hide()) is really important. Other lines just improve a little the look of the Searching Dialog.

jqgrid multiple datepickers and autofocus

i think i found a strange bug in jqGrid.
If you click on this link you can see a jqGrid with a pager. If you click on the '+' button you get the add form in which the 2 datepickers work as expected.
If you now click on this link you can see the very same table, and the very same add button. Anyway if you try to set the second date using tha datepicker you will notice that the focus moves back to the first input, opening the first datepicker.
The example does not work because it has the first field (Id) hidden, so the real first field is a datepicker. Moreover, the edit form is modal.
Last, if you click in this link the behaviour is correct even if the first field is a datepicker. The only thing i changed is the modal property (to false, before it was true).
However, i NEED to hide the Id field AND have a modal window, so i have to to get rid of this problem...
Can someone suggest a solution or an hint?
Thanks
PS: notice that if you set modal: false, you still get the black/transparent overlay like if the window is modal BUT it is not! If you click outisde the edit form it will be closed. This is not acceptable for my requirements.
try to set jqModal parameter into false
var editParams = {
modal: true,
jqModal:false,
... //other options you need
}
grid.editGridRow(row_id, editParams);
for more information see answer Oleg's analisys

Resources