jQWidgets Forums
jQuery UI Widgets › Forums › Grid › some requerements
Tagged: cell editing, grid editors
This topic contains 1 reply, has 2 voices, and was last updated by Peter Stoev 13 years, 2 months ago.
-
Authorsome requerements Posts
-
i got a couples question …..
first how can i do when a cell is editing the color of font and background change….
how can i set editmode in many ways … for example click , celledit,row select …. it will be programmatic… how it is that i have to implement?
Regarding your questions:
1. There’s no such built-in functionality.
2. The Grid supports several edit modes – activate an editor when the user click’s a cell, double-clicks a cell or clicks on an already selected cell.
The code below will initialize a Grid. When the user clicks a cell, the editor will be activated.
$("#jqxgrid").jqxGrid({ width: 670, source: dataAdapter, editable: true, editmode: 'click', theme: theme, selectionmode: 'singlecell', columns: [ { text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90 }, { text: 'Last Name', datafield: 'lastname', columntype: 'textbox', width: 90 }, { text: 'Product', columntype: 'dropdownlist', datafield: 'productname', width: 177}, { text: 'Available', datafield: 'available', columntype: 'checkbox', width: 67 }, { text: 'Ship Date', datafield: 'date', columntype: 'datetimeinput', width: 90, cellsalign: 'right', cellsformat: 'd', validation: function (cell, value) { var year = value.getFullYear(); if (year >= 2013) { return { result: false, message: "Ship Date should be before 1/1/2013" }; } return true; } }, { text: 'Quantity', datafield: 'quantity', width: 70, cellsalign: 'right', columntype: 'numberinput', validation: function (cell, value) { if (value < 0 || value > 150) { return { result: false, message: "Quantity should be in the 0-150 interval" }; } return true; }, initeditor: function (row, cellvalue, editor) { editor.jqxNumberInput({ decimalDigits: 0, digits: 3 }); } }, { text: 'Price', datafield: 'price', width: 65, cellsalign: 'right', cellsformat: 'c2', columntype: 'numberinput', validation: function (cell, value) { if (value < 0 || value > 15) { return { result: false, message: "Price should be in the 0-15 interval" }; } return true; }, initeditor: function (row, cellvalue, editor) { editor.jqxNumberInput({ digits: 3 }); } } ]});
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.