I want to set the JQGRID row bgcolor depends upon the condition? How to do it? Im using php.
Thanks in advance,
look at jqGrid Coloring an entire line in Grid based upon a cells value. You should examine current row values after data loading (inside of loadComplete for example). For the elements where you want change the background-color you should remove 'ui-widget-content' css class and then add another class which defines the color which you want.
Related
I'm using Angular slickgrid and I want to change the cell color if the value is present in that cell.
Note: I want the color only for the cell not the whole row.
Is there any best way to iterate over all the cells and set the color or any equivalent solution?
I have a requirement to show the different cell colors depending on the data. Red color if the data is coming from the server and not changed (not dirty). If the data is edited or added new row (dirty), the cell color would be blue. I have updated the question.
function renderCellWithColor(cellNode, row, dataContext, colDef) {
if (dataContext[colDef.field] != ""){
$(cellNode).addClass("requiredClass"))
}
}
I'm using this function using enableAsyncPostRender. This does not work if I edit or add new row.
Use the option cssClass on the column definition or use a Custom Formatter returning an object following the FormatterResultObject, see Wikis Custom Formatter - FormatterResultObject - Wiki and sample - Wiki, the FormatterResultObject has the advantage of applying the CSS class to the cell container via the property addClasses and using the formatter object is the only way to get access to the cell container.
In kendo tree list, how to change the color of entire child row depending on certain data value?
I tried the method mentioned here: How to change color of row depending on a row's value in a Kendo UI Grid
it does not work, any other solution?
Thanks in advance.
You can iterate through rows in dataBound event and set classes or whatever you want there.
Example
in JQGrid 3.8, is it possible to have an icon instead of text in a column ?
I don't think it's possible but if you have a trick, i'd be happy
There are many ways to add icons in the grid. First way is: the data which be placed in the column header (colNames) or inside of the cell data could be HTML data. So you can easy insert the <img> element in the grid. One more method is th use custom formatters. See here some demos. If the standard jQuery UI icons contain all the icons which you need I would recommend you to use there.
While using inline editing , Is there a way to set focus on the first cell inside a row, without using the cell id?
Can the focus be set by the cell index number (position inside the row)?
Thank's In Advance.
If I understand you correct you need just use editCell method of the cell editing. For example
$("#list").jqGrid('editCell',1,3,true);
See the demo.
I need to resize the JQGrid column at runtime.
For eg: the column width for the column was 100px when it is loaded. I need to change it to 200 afterwards.
Please help.
Unfortunately there is no way to do this using the jqGrid API. From the documentation:
As mentioned above the options in colModel can be get or set using the methods getColProp and setColProp. Below are options which can not be changed dynamically when the grid is constructed (If changed they do not have effect or will cause the grid errors). For some of these options there are methods available to change the value:
name
width
resizable
label (method avail.)