View Full Version : Accessing gridPanel Row Data into D&D ddText?

27 Jun 2011, 3:00 PM

Is there a way to access gridPanel row data into the ddtext?

Thank You

28 Jun 2011, 3:50 AM

Im using the rowmousedown to do a function that tries to capture the row data. The only problem is I cant convert it to a string. Im using the following, but it's not correct. It's trying to move an object. How do I move the text value?

Im a newbie at this ...

ddText : vvText,
listeners : {
rowmousedown : doMouseDown,

function doMouseDown(thisGrid, rowIndex, evtObj) {
var recordVV = thisGrid.getSelectionModel().selectRow(rowIndex);
vvText = recordVV.get('SCVESL');

28 Jun 2011, 1:46 PM
It's trying to move an object. How do I move the text value?

What do you mean by this? ddText is purely a way to specify the message shown on the drag proxy, it doesn't change what data is actually dragged.

If you want to set ddText dynamically you can't do it just by setting the value of vvText. Try setting gridPanel.ddText or override getDragDropText().

29 Jun 2011, 8:43 AM
I am trying to set the ddText field vvText. The function is getting a selected row and Im then trying to update ddText field vvTest. But it's not accepting it. The ddText field is not being updated or accepted or whatever.

Im not sure if rowmousedown is the correct listener to use, or what. But the ddtext field vvText is not being populated with the text. vvText is initialized as "" and not being changed within the function ...

30 Jun 2011, 3:13 PM
I could be wrong, but I think you've misunderstood how pointers work in JavaScript.

You seem to think that what you're doing is creating the following:

ddText --> vvText --> ""

which you are then trying to update to:

ddText --> vvText --> the value of SCVESL

However, that is not how JavaScript works. What you are in fact doing is creating the following relationship:

ddText --> "" <-- vvText

and when you reassign vvText it updates where the pointer is pointing:

ddText --> ""
vvText --> the value of SCVESL

However ddText will continue to point at the same value in memory.