PDA

View Full Version : Add numerous search params to form



infernoz
7 May 2012, 11:32 AM
Hello,

I am using Ext JS 4.1

I set up a form to take in two values A and B. When the user hits a search button, A and B are sent to the server to be processed and will return a response which I will capture and show in a grid on the front end.

What I would like to implement is a form that will take in n number of A and B pairs (ex: {A1,B1}, {A2,B2}, {A3,B3}), which are entered in by the users and then send that to the server. I'm thinking the number n can be a max of 10-20.

To do this, I was thinking of creating a new button and textarea, which when either is clicked, will pop up a new window (xtype window). This window will allow the users to enter in A's and B's and if they want to enter in more pairs, the window will have a button saying "Add addtional A/B pairs", which will render new rows in the window for them to enter data into. Closing the window will write these pairs to a store for me to send to the backend when Search on the form is pressed.

This is doable I believe, but to save time, was wondering if something like this has already been added into Ext JS or a plugin that I could use to make my life easier.

Cheers,

infernoz

scottmartin
14 May 2012, 1:32 PM
This should be fine. I would send the parameter as a JSON

Ext.encode(myobject)

Regards,
Scott.