[ 3 posts ]

ravikiran

  • Username: ravikiran1288
  • Joined: Mon Nov 07, 2011 9:17 pm
  • Posts: 94
  • Offline
  • Profile
Tags:

How to get the value of cell in yui datatable

Post Posted: Sat Nov 12, 2011 10:04 am
+0-
when i use the foloowing code

myDataTable.subscribe("cellClickEvent",function(oArgs) {
var c = this.getTdEl(oArgs.target);
alert(c.innerHTML);
});

i am getting the following output in alert box

<DIV class=yui-dt-liner id=yui-gen24>12</DIV>

but the required output should be 12.

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: How to get the value of cell in yui datatable

Post Posted: Sat Nov 12, 2011 2:38 pm
+0-
Hello ravikiran.

Usually it is used the following snippet to retrieve the content of a cell:

Code:
  myDataTable.subscribe("cellClickEvent", function (ev) {
                var target, column, field;

                target = ev.target;
                column = this.getColumn(target);

                if (column.key === "mycolumn") {
                    field= this.getRecord(target).getData("myField");

                }
                // ...
             }


Regards,
IceBox

ravikiran

  • Username: ravikiran1288
  • Joined: Mon Nov 07, 2011 9:17 pm
  • Posts: 94
  • Offline
  • Profile

Re: How to get the value of cell in yui datatable

Post Posted: Sun Nov 13, 2011 1:12 am
+0-
thanks icebox
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum