0
votes

I have a requirement to add the data in a grid panel on a event. Note that i dont want to insert the complete rows here but want to dynamically add the data in columns.

for example when the user clicks on the checkbox whose data will go into "want" column(refer the image below) i want to populate it in the below format. if the user clicks on the data which has to go in "dontwant" column it has to populate in below format

enter image description here

how can i achieve this... pls help

1
Please re-form your question. It's not clear what exactly are you trying to ask.sha
Sorry. Renaming didn't help. Still absolutely no idea what you're talking about.sha
@Raj: The item will be added to want/dont want column when you choose by ticking on the checkbox item on another list? If it is your idea, you can have a grid with 3 columns and call hide()/show() the corresponding column after adding the chosen item to gridrow.U and me
Here is the whole question... If I add any record into a grid It will occupy the whole row. So if u try to analyse the above image where primary has a total of 5 rows. But want column has 5 data and don't want column has only 2 data in it. It is whole dynamic to mPunith Raj
I found the Grouping functionality on the grid panel may help. Surely it cannot be as much flexible as your needs.U and me

1 Answers

1
votes

The grid is constituted from columns config of grid panel together with grid store structure. That means ExtJS defines the grid panel exactly a Grid with each row is a record of grid store (columns are just what field names showed on the grid). So "keep pushing data in column irrespective of the row index?" is unable to. Let's imagine this:

  • How can the grid store define the "record" in your case?
  • How can the grid provide methods to delete/change the "composite records"?

Don't forget that ExtJS grid is not just to display data but also to communicate with server to perform CRUD via its proxy.

You still can achieve your aim if the grid is just for displaying data. In this case, you create a dummy store with fields: ['Family', 'Want', 'DontWant'] and use columns config to show the data. Then directly interact with records in grid store to modify 'Want'/'DontWant' value when you check/uncheck data (add new if the record not exists)