简体   繁体   中英

Store Datatable Client side

I have attached screen shot here. http://imageshack.us/photo/my-images/836/abcpqr.png/ . In my 1st 2 column there is drop down with list of items inside it. And third column is output column whose value is depends upon dropdown selected items. I am having all the combinations of 2 dropdown items and its output inside a datatable. Because of requirement i cant use server side processing.

So I want to store that output table client side. And depends on the dropdown seleceted value i want to show output from output table to 3rd column textbox. I want to achieve this using client side(Javascript/Jquery).

So please help me how to achieve this.

Thanks in advance.

you can store content at client side by html5 storage

This means you can start using the API's sessionStorage and localStorage

here is tutorial to learn how to use

html5 storage

I got the solution. It will be useful for someone else in the future.

I have created hidden listview which contains only itemtempalte with blank span inside it. And assign class to span to differentiate each span and created custom attributes which is having desired output. eg

  <ItemTemplate> <span id="residualMapping" class='<%# string.Format("ABC_{0}_{1}",Eval("firstdropdownValue"),Eval("seconddropdownValue")) %>' output='<%# Eval("output") %>' > </span></ItemTemplate>

And assign classes to each dropdown and label. And finaly i have handled each drodown change event. In this event i am getting selected value of both dropdowns and using this value i am catching span and from span i am getting its custom attribute value. And this value i am assigning to the output label.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM