Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have attached screen shot here [^].

In my first 2 columns, 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.
Posted
v2
Comments
Hi Vikas,

Let me explain what I have understood.

You are selecting some values from the dropdowns and then getting some data based upon them and storing in a datatable and showing inside the output textbox, right?

If yes, then plz answer some questions.
1. When you select the dropdown values, after that in which event you are getting data into datatable?
2. As in the image, you are just concatenated the dropdown values into the textbox, so why you exactly need a datatable?
3. How are you getting data and filling the datatable?

Please explain all these by clicking on the reply icon in this comment box.
And post some relevant code, if necessary.

Thanks,
Tadit
vikas_pawar 6-Feb-13 7:26am    
No, that output table will be filled only once in PageLoad Event. And i want to send that table to client side store. There will be not be postback on dropdown change event.
And about that output textbox, it is not just concatenation, it may be anything. This was just for demo.
So, you want to get some data and fill one datatable in jQuery when you select option from both the dropdown.

If so, then show me some code, what have you tried so far and where you exactly want this. I will try to modify your code then.

1 solution

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. e.g
HTML
<itemtemplate>
 <span id="residualMapping" class="<%# string.Format("ABC_{0}_{1}",Eval("firstdropdownValue"),<br mode="hold" />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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900