Hi all,
I have selection mode: 'row' enabled. what I am trying to do is passing the value of the first cell of a row to an event handler when it is triggered.
The event is triggered when a row is selected.. However, args.row is not accessible and args.row.element[0].cells[0].textContent is undefined.
Did I miss any include files? I have included the following files.
jquery-1.5.1.min.js,
jquery.tmpl.js,
jquery-ui-1.8.11.min.js,
ig.ui.min.js
ig.ui.min.css
jquery.ui.custom.min.css
It is not so clear to me about what files should be included even I read api.
here is the code:
features: [ { name: 'Selection', mode: 'row', multipleSelection: false, rowSelectionChanged: function (evt, args) { alert(args.valueOf.length); alert("i am here"); alert(args.row.element[0].cells[0].textContent); } }, ...
Thanks,
Betty
Hi Betty,
I guess you got this error in Internet Explorer 7/8? textContent property is available from IE 9, so you should use other method to extract cell content. For example jQuery .text() or .html() will do the trick.
Here is how your code should look like:
Hope this helps,
Martin Pavlov
Infragistics, Inc.
Hi Martin,
I am using IE8. When I switch to firefox I did get textContent property without using text().
However, I am expecting intellisense for args so when type args.row so I know how to access the right property. But I don't see any. Aee attached image.
I guess I still miss some files? Or am I not reasonable?
bettysun said: I am using IE8. When I switch to firefox I did get textContent property without using text().
textContent property is part of DOM Core Level 3 Specification. textContent is supported in all major browsers except Internet Explorer 8 and below. That's why in order to support most of the browsers (including IE 8 and below) you need to use jQuery.text() which behind the scenes will return textContent if it is available or innerText in case of IE 6/7/8.
bettysun said: However, I am expecting intellisense for args so when type args.row so I know how to access the right property. But I don't see any. Aee attached image. I guess I still miss some files? Or am I not reasonable?
No, you're not missing references. Unfortunately we don't provide Intellisense for our jQuery controls yet. For now your best source of information is our API Docs documentation. Furthermore you can use your favorite browser to debug and inspect the args argument object and see what properties it offers to you.
Hope this helps,Martin PavlovInfragistics, Inc.
Martin,
Ok, thanks for letting me know.