| Page 1 of 1 | [ 4 posts ] |
|
Hey all,
I have a datatable in which a column has a custom formatter applied. When the initial data is loaded, everything works as expected. However, when I use addRow, the new row doesn't use the custom formatter. I know the data is there, but the datatable displays nothing. Do I need to re-apply the formatter to the new row somehow? |
|
addRow does use custom formatters, what it doesn't do is use DataSource's parsers so you have to provide the data already converted to internal format, dates as instances of Date object and such. Formatters, if they cannot make sense of the data they receive, such as a date as a text string, will let it through untouched.
|
|
The formatter is just changing the display based on the string data of the cell. For example, in one column if the data is "1", the formatter displays "Traditional"; in another it displays a certain picture based on the data.
Like I said, this works fine on the initial load, but when adding in a row there is nothing in the cells. Obviously, I'm over-looking something. |
|
OK, got it. Turns out that addRow was supplying an integer to the dataTable and the formatter was looking for a string. I thought that it would be able to automatically handle the typing issue, but it seems not.
|
| Page 1 of 1 | [ 4 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