-
31 Jan 2012 9:27 PM #1
Unanswered: ExtJS4 GridView panel : Adding a subheader row
Unanswered: ExtJS4 GridView panel : Adding a subheader row
Hello
We have a requirement where we need to add a row between the Grid Header row and Grid Data rows. The sub header row will contain some additional information pertaining to the column. The information may or may not be static. What is best way to insert the row in the grid?
Any help would be highly appreaciated. Thanks in advance.
Regards
Kalpesh
-
1 Feb 2012 7:03 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 434
- Answers
- 3102
You can render anything to the grid or you can insert a record into the grid at index zero. I would render my own component or just element personally.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
1 Feb 2012 10:02 PM #3
@mitchellsimoens
Thanks for the reply. I need the functionality/behaviour across all the pages in my application, hence extending the grid component may be the solution which i need to pursue. Since i am new to ExtJS developement i am not sure how to accomplish this. I have read some articles on how to inherit components, but i am not able to find which property/method needs to be called inorder to insert the new row. Any suggestions would be highly appreciated.
By the way, since this row is not part of the actual records, i am not sure whether adding to index 0 will be ideal.
Regards
Kalpesh
-
28 Feb 2013 6:39 PM #4
A subheader can be achieved by adding a second columns:[] configuration under each item in your columns structure. I use this for just one header in my grid (which has three subheaders) but I am sure it is applicable to each column:
Example being:
Code:columns: { items:[{ header: 'First', sortable: false, dataIndex: 'fname' },{ header: '# of Pets', id: 'numPets', columns:[ { text: 'Cats', id: 'cats', menuDisabled: true, dataIndex: 'catsnum' width: 60 },{ header: 'Dogs', id: 'dogs', menuDisabled: true, dataIndex: 'dogsnum', width: 50 },{ header: 'Fish', id: 'fish', menuDisabled: true, dataIndex: 'fishnum', width: 75 }] },{ header: 'Address', sortable: true, dataIndex: 'address', width: 30 }] }
-
28 Feb 2013 10:53 PM #5
Hello PKTRaul
I shall check it out. Can you possibly provide a screenshot of how it would look?
Regards


Reply With Quote