Discussion:
[Dojo-interest] Dojo dgrid - change cell value based on another cells value
ps202
2013-11-14 15:05:21 UTC
Permalink
I have a dgrid. It is connected to a store and to a database. I have a column
in the dgrid, called type. There is another column, called subtype. It takes
it's parentid values from type.

I would like to add a FilteringSelect to the subtype column. When this
FilteringSelect changes, I would like to pass the parentid value to the type
column and display it, so change the value of the type column to the value
based on the selection in the subtype column.

How can I achieve this?

I am having trouble with cross referencing the columns...

Thanks!




--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dojo-dgrid-change-cell-value-based-on-another-cells-value-tp4000046.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
herman vierendeels
2014-01-15 08:26:55 UTC
Permalink
if dgrid is Sitepen's dgrid:

you could listen for event dgrid-datachange
event object contains: rowId: row.id

By means of row.id , you can get row and other column in that row
Post by ps202
I have a dgrid. It is connected to a store and to a database. I have a column
in the dgrid, called type. There is another column, called subtype. It takes
it's parentid values from type.
I would like to add a FilteringSelect to the subtype column. When this
FilteringSelect changes, I would like to pass the parentid value to the type
column and display it, so change the value of the type column to the value
based on the selection in the subtype column.
How can I achieve this?
I am having trouble with cross referencing the columns...
Thanks!
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dojo-dgrid-change-cell-value-based-on-another-cells-value-tp4000046.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
lyz19890927
2014-09-01 13:03:39 UTC
Permalink
Now we can get one cell value, but how can we change the other cell value? It
drives me crazy!



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dojo-dgrid-change-cell-value-based-on-another-cells-value-tp4000046p4003480.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
sugantha
2014-10-17 14:21:36 UTC
Permalink
Did you get any solution to the problem. I am also trying to set a value to a
dgrid column on edit of another column.



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dojo-dgrid-change-cell-value-based-on-another-cells-value-tp4000046p4003991.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
Ramil Rakhmetov
2014-10-17 15:31:26 UTC
Permalink
pretty short

var columns = [
{label: 'id'},
editor({ field: 'typeField'}),
editor({ field: 'sybTypeField', ....selectionstuff}),
{label: 'name'}
];
grid.on("dgrid-datachange", function (evt) {
// row object
var rowObject = evt.cell.row.data;
if(evt.cell.column.field == "sybTypeField")
{
rowObject.set("sybTypeField",evt.value)
rowObject.set("typeField",typeFromSybTypeOptions);
// repaint only this row
evt.grid.store.notify(rowObject);
}
// listerning for dgrid-datachange here wil not update dirty for grid.save
// you should grid.updateDirty(evt.rowId, evt.cell.column.field,
evt.value);
});
Post by sugantha
Did you get any solution to the problem. I am also trying to set a value to a
dgrid column on edit of another column.
--
http://dojo-toolkit.33424.n3.nabble.com/Dojo-dgrid-change-cell-value-based-on-another-cells-value-tp4000046p4003991.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Met vriendelijke groeten,

Ramil Rakhmetov
*Senior Developer*

*PEOPLEWARE*
Duwijckstraat 17
2500 Lier - Belgium
+32 3 448.33.38 Facebook
<http://www.facebook.com/pages/Peopleware/115011795207742> Twitter
<http://twitter.com/#!/PeopleWareBE>
www.peopleware.be
Loading...