| Page 1 of 1 | [ 9 posts ] |
|
Hi All,
I have a datatable, where I can entere some column values through input box. The problem arises when I move to other page using paginator, and then coming back to the previous page I could not get that changed value. Note : I could note use cell editor or bulk editor. Lokking for some help. Thanks |
|
You must update the Record with the values entered into the input boxes. Use a formatter to restore the value from the Record into the input box.
The paginator redraws all the HTML based on the information on the Record. Whatever is not in the Record it is gone. |
|
Thanks Satyam for your quick reply.
I don't think its gonna help me. I think you mean to say I need to save my data before the paginator takes on. Need one more clarification, can we add some local data to a datatable which is not a part of data retrived from the server ? If its possible, can u please explain how to achieve this. |
|
You can save any field into the Record regardless of whether it had been declared before or not. If you use Record's setData method with a previously unknown field name, that field will be created.
The fields you declare on the DataSource just tell the DataSource which fields to fetch, parse and pass on to the DataTable, it does not restrict the DataTable to those fields. Likewise, the columns you declare in the columns definitions tell the DataTable what columns to show, but there might be more or fewer columns than fields in the Record. You may choose to listen to Paginator's changeRequest event and make sure to update all the fields in the record before the page does change or keep updating the record for every keystroke on the fields. |
|
Satyam I do tried to add a field using the record's setData method.
var oRecord = new YAHOO.widget.Record(); oRecord.setData("new_feild", new_feildValue); But when I tried to access this value in the formatter, it always shows undefined. I guess its getting reset on pagination call. Could you please readdress this issue. Thanks |
|
If you are creating a new Record instance apart of the DataTable, don't expect it to know anything about it. You have to modify the Record instances in the RecordSet associated to the DataTable.
You are trying to write some advanced stuff and it seems you are not well acquainted with DataTable. Why don't you read the two-part article recommended at the very top of the DataTable User Guide? |
|
Oh oRecord.setData("new_feild", new_feildValue); is the only line I intended to post.
And oRecord is the exsisting record from the datatable. |
|
Part of the answer is still valid: have you read those two tutorials? Otherwise, if you can post a working copy somewhere: fiddle.net, or just the code in a gist or pastebin, that would be great.
|
|
Thanks Satyam.
Yours suggestions were of great use. My issue got resolved. Thanks Again |
| Page 1 of 1 | [ 9 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