jQWidgets Forums
jQuery UI Widgets › Forums › Grid › editable mode
Tagged: disable column editor, grid, grid editing, gridview, jquery gridview
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 13 years ago.
-
Authoreditable mode Posts
-
Hi
For example:
I have created a grid with 4(columns)*10(rows) and setted the value of “editable” to true.My Question:
Is it possible
1–Setting first column to “uneditable”
2–Setting The background of first column to “gray”Best Regards,
JerryHi Jerry,
Each column has an ‘editable’ property and if you want to disable the column’s editing, set its ‘editable’ property to false.
Code example:
{ text: 'First Name', columntype: 'textbox', editable: false, datafield: 'firstname', width: 90 }
jQWidgets Team
http://www.jqwidgets.comHi Peter:
Thank you for your answer. I’ve resolved my first problem with your help.
The another question is :
Can I change the background color of the colume by setting the value of property ?
Best Regards,
JerryHi Jerry,
It is possible to change the cells rendering of all cells in a column by defining a custom render function. The function is called when a cell is going to be rendererd.
To change the background color of a cell you can use a code like this:
$("#jqxgrid").jqxGrid({ width: 670, source: dataAdapter, theme: theme, columnsresize: true, columns: [ { text: 'First Name', dataField: 'firstname', cellsrenderer: function (row, column, value) { return '<div style="background: #aabbcc; width: 100%; height: 100%;">' + value + '</div>'; }, width: 100 }, { text: 'Last Name', dataField: 'lastname', width: 100 }, { text: 'Product', dataField: 'productname', width: 180 }, { text: 'Quantity', dataField: 'quantity', width: 80, cellsalign: 'right' }, { text: 'Unit Price', dataField: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' }, { text: 'Total', dataField: 'total', cellsalign: 'right', minwidth: 100, cellsformat: 'c2' } ]});
Hope this helps you.
jQWidgets Team
http://www.jqwidgets.comHi Peter:
Thank for your answer.
It works when the columntype is edit.
But it doesn’t works when the columntype is checkbox.
Can I change the background color of the checkbox colume ?
Best Regards,
JerryHi Jerry,
That’s true, the custom renderer function will not be called for Checkbox column. There’s an option to change the background of all Grid cells by editing the “.jqx-grid-cell” CSS class in the jqx.base.css file.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.