FilteringTable double click

In setting up the double click events for a Filtering Table
programmatically, how come this works:

dojo.event.connect(row[i], "ondblclick", BuildCodes,
"rowSelected");

but this doesn't:

row[i].ondblclick = BuildCodes.rowSelected;

where row[i] is the row of the FilteringTable that I'm working with.

Are they not programmatically equivalent?

Matthew Engel
Senior Programmer/Analyst
State University of New York at Stony Brook
mengel@notes.cc.sunysb.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061215/9134...

Comments

Hi Matthew,
I tried doing the same it doesnt seem to work at all. Is there anything i
am doing wrong?

Thanks
Sandeep
--
View this message in context: http://www.nabble.com/FilteringTable-double-click-tf2829024.html#a798576...
Sent from the Dojo mailing list archive at Nabble.com.

Do you have a code snippet I can see? Here's what works...

var row =
document.getElementById('aBLTblePlaceHolder').getElementsByTagName('tr');
// Row of table used as Filteringtable
for (var i=0; imengel@notes.cc.sunysb.edu

sandeepa
Sent by: dojo-interest-bounces@dojotoolkit.org
12/20/2006 02:21 AM
Please respond to
dojo-interest@dojotoolkit.org

To
dojo-interest@dojotoolkit.org
cc

Subject
Re: [Dojo-interest] FilteringTable double click

Hi Matthew,
I tried doing the same it doesnt seem to work at all. Is there anything
i
am doing wrong?

Thanks
Sandeep
--
View this message in context:
http://www.nabble.com/FilteringTable-double-click-tf2829024.html#a798576...
Sent from the Dojo mailing list archive at Nabble.com.

_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
Dojo-interest@dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061220/1845...

Thanks for the sample. Here's what i was trying earlier which did not work

var varTable = dojo.widget.byId("dataTable");
for (var i = 0; i < data.length; i++) {
var bundle = data[i];
var rowEntry = {
Id: i,
name: bundle['name'],
runValue: bundle['runValue'],
nodePath: bundle['nodePath'],
state: bundle['state']
}
rows.push(rowEntry);
dojo.event.connect(rowEntry, "ondblclick", table,
'onVariableSelect');

}
varTable.store.setData(rows);
}

I am yet to try with your sample.

Thanks
Sandeep
--
View this message in context: http://www.nabble.com/FilteringTable-double-click-tf2829024.html#a798994...
Sent from the Dojo mailing list archive at Nabble.com.

Strange that following code which does not have BuildCodes as one arguments
to dojo.event.connect call works for me.

var row =
document.getElementById('aBLTblePlaceHolder').getElementsByTagName('tr');
for (var i=0; ihttp://www.nabble.com/FilteringTable-double-click-tf2829024.html#a799069...
Sent from the Dojo mailing list archive at Nabble.com.

BuildCodes is the scope/class of rowSelected. Someone correct me if I'm
wrong, but I think it defaults to dojo if none is specified.

Matthew Engel
Senior Programmer/Analyst
State University of New York at Stony Brook
mengel@notes.cc.sunysb.edu

sandeepa
Sent by: dojo-interest-bounces@dojotoolkit.org
12/20/2006 09:13 AM
Please respond to
dojo-interest@dojotoolkit.org

To
dojo-interest@dojotoolkit.org
cc

Subject
Re: [Dojo-interest] FilteringTable double click

Strange that following code which does not have BuildCodes as one
arguments
to dojo.event.connect call works for me.

var row =
document.getElementById('aBLTblePlaceHolder').getElementsByTagName('tr');
for (var i=0; ihttp://www.nabble.com/FilteringTable-double-click-tf2829024.html#a799069...
Sent from the Dojo mailing list archive at Nabble.com.

_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
Dojo-interest@dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061220/a31b...

Can't answer you on the event question (though you shouldn't ever assign an
event directly like that), but I can say that you should probably attach
that event handler either to the tbody element or to the table element, and
not to every row. That way it's only created once, and you don't have to
try to reassign it to each new row that is created.

trt

mengel wrote:

--
View this message in context: http://www.nabble.com/FilteringTable-double-click-tf2829024.html#a799188...
Sent from the Dojo mailing list archive at Nabble.com.

Great. I tried connecting it to the tbody element, but it didn't work,
but connecting it to the table itself worked fine. Thanks for saving my
users some CPU.

Working code:
var body = document.getElementById('aBLTblePlaceHolder');
dojo.event.connect(body, "ondblclick", BuildCodes, "rowSelected");

Did Not work:
var body =
document.getElementById('aBLTblePlaceHolder').getElementsByTagName('tbody');
dojo.event.connect(body, "ondblclick", BuildCodes, "rowSelected");

Thanks,
Matthew Engel
Senior Programmer/Analyst
State University of New York at Stony Brook
mengel@notes.cc.sunysb.edu

Tom Trenka
Sent by: dojo-interest-bounces@dojotoolkit.org
12/20/2006 10:24 AM
Please respond to
dojo-interest@dojotoolkit.org

To
dojo-interest@dojotoolkit.org
cc

Subject
Re: [Dojo-interest] FilteringTable double click

Can't answer you on the event question (though you shouldn't ever assign
an
event directly like that), but I can say that you should probably attach
that event handler either to the tbody element or to the table element,
and
not to every row. That way it's only created once, and you don't have to
try to reassign it to each new row that is created.

trt

mengel wrote:

--
View this message in context:
http://www.nabble.com/FilteringTable-double-click-tf2829024.html#a799188...
Sent from the Dojo mailing list archive at Nabble.com.

_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
Dojo-interest@dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061220/587d...

Second one didn't work because you tried to attach it to a node list and not
a node.

var body =
document.getElementById('aBLTblePlaceHolder').getElementsByTagName('tbody')[0];
dojo.event.connect(body, "ondblclick", BuildCodes, "rowSelected");

trt

mengel wrote:

--
View this message in context: http://www.nabble.com/FilteringTable-double-click-tf2829024.html#a799713...
Sent from the Dojo mailing list archive at Nabble.com.

Back to top