I am using dgrid for displaying data in grid format , it has four columns. all are editable
I have used following way to declare it.
<table id="grid" data-dojo-type="dgrid.CustomGrid" data-dojo-props="store: memoryStore">
<thead>
<tr>
<th data-dgrid-column="dgrid.editor({ field: 'id' }, dijit.form.TextBox, 'click')">ID</th>
<th data-dgrid-column="dgrid.editor({ field: 'name' }, dijit.form.TextBox, 'click')">Name</th>
<th data-dgrid-column="dgrid.editor({ field: 'description' }, dijit.form.TextBox, 'click')">Description</th>
</tr>
</thead>
</table>
My Problem is , when I will edit first column , after editing it should set focus on second column and show cursor in that cell so I can start editing second one ; same is for third column.
I am very much new to dojo and dgrid. I found some APIs on sitepen but couldn’t solve my problem
Please help me on this
There is
dgrid/Grid::edit(cell)method to start with.I used
dojo/aspect::afterto add an event listener to an editor widget (e.g.dijit/form/TextBox), if it does not exist, to listenkeypressevent for a specific key, in my case TAB, and then callgrid.edit(cell)with the cell that should be edited next.See a working example at jsFiddle: http://jsfiddle.net/phusick/2jU7R/
It is far from finished, but at least it can provide a possible directon. Use double click to edit and press TAB when editing to jump to the following cell.