| Page 1 of 1 | [ 6 posts ] |
|
I have chosen to use a different loader than the loader div in the DataTable, so I have added the display:none attribute to the yui-dt-loading class. This way, when the message tbody is made visible, the loading div still doesn't show.
Now I want to show the message area when an error occurs or if there are no records. So, I saw that there is a yui-dt-empty and yui-dt-error class that get applied to this div as well. The problem is, that these classes are being added when the corresponding message is shown, but not being removed when the message is removed. Example: When the dataset comes back empty, the 'No Records' message is displayed, and the yui-dt-empty class is applied to the div, but the yui-dt-loading class is not removed. Same problem when 'No Records' is removed, the yui-dt-empty class is not removed. I am using 2.8.0r4 Thanks in advance for your help. |
|
I believe this is either by design or a bug, but I don't see anything in the DT code that would remove the yui-dt-loading attribute. Perhaps you can fix this by tapping into the post render event?
Code: mydatatable.on('postRenderEvent', function () { if (this._elTbody.rows.length === 0) { YAHOO.util.Dom.removeClass(this._elMsgTd, 'yui-dt-loading'); } }) |
|
Come to think of it you probably don't even need to check that there are no records, just remove it at postRenderEvent.
|
|
I also did not want the message in the table as I display a loading message outside the table. I just set the MSG_EMPTY table configuration attribute to an empty string. Note, setting it to null doesn't work as the YUI code interprets this as the configuration attribute not being set and uses the default.
|
|
Sorry, meant to say MSG_LOADING attribute.
|
|
That worked perfectly! Thank you.
|
| Page 1 of 1 | [ 6 posts ] |
| 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 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group