I have a dgrid with 2 columns: Name, Predecessor.
Each row has another row as predecessor, which I am setting it to be. The order of the rows is not relevant for this.
In the predecessor column I choose from a list the name of another row as a predecessor.
My problem is that when I change the name of the row after I set it as a predecessor to another row, It would not automatically change with the new name (which is expected). Of course after a manual refresh of the page I will see the new name.
How can I manually change the name of the row in the wanted cell without manually refreshing the page or without using the grid.refresh() method after the save() has been made? For example setting a value in a cell in the callback of the save() function.
I am using dojo.store.JsonRest. And I am using the grid.save() method to send the PUT request to my store. The sore is a PHP page which rends it's response back to the grin in JSON.
My grid looks like this:
<table id="myGrid" data-dojo-props="query:{param: 'value'}">
<tr>
<th data-dgrid-column="editor({field:'name',id:'name',width:175,sortable:false, unhidable:true,formatter:'do_highlight',editor:TextBox,editOn:'dblclick'})">Name</th>
<th data-dgrid-column="{field:'predecesors', id:'predecesors', width:175, sortable:false,renderCell:milestones.render_predecessor}">Predecessor</th>
</tr>
</table>
My save function called on the "dgrid-datachange" event, looks like this:
this.end_edit = function(event){
var item = event.grid.store.get(event.cell.row.id);
item.__edited_field = event.cell.column.field;
event.grid.updateDirty(event.cell.row.id, field, new_value);
var def = event.grid.save();
def.then(null, ajax.show_error);
}
If someone has an idea how to refresh that specific cell I would much appreciate. I would like to avoid the refresh() function because it gives me errors.