PDA

View Full Version : Row Grouping on multiple column in a Editor Grid Panel



rameshbacha
4 Mar 2013, 11:38 PM
Hello All,

Is there a way to group the rows based on multiple columns in a Editor Grid Panel?

My requirement is like a table data like below..




slabNo

startvalue

EndValue

awardNo

awardType

awardValue

awardDescription



1

10

20

1

CASH

10$

<editable Textfield>



1

10

20

1

CASH

8 Euro

<editable Textfield>



1

10

20

2

POINTS

100 points

<editable Textfield>



2

21

9999

1

CASH

6$

<editable Textfield>



2

21

9999

1

CASH

4 Euro

<editable Textfield>



2

21

9999

2

POINTS

90 points

<editable Textfield>





I want to display this data in a ExtJs3.4 Editor Grid Panel as follows



slabNo

startvalue

EndValue

awardNo

awardType

awardValue

awardDescription



1

10

20

1

CASH

10$

<editable Textfield>











CASH

8 Euro

<editable Textfield>









2

POINTS

100 points

<editable Textfield>



2

21

9999

1

CASH

6$

<editable Textfield>











CASH

4 Euro

<editable Textfield>









2

POINTS

90 points

<editable Textfield>






Is there any way to achieve the above format in ExtJS 3.4. I haven't found any example in the forums.

Thanks for your help in Advance

mitchellsimoens
7 Mar 2013, 9:25 AM
You could probably keeps a mapping of the columns and what values are shown and within the column renderers check this mapping. If the value is not in the mapping show it, if not then return an empty string (or whatever).


{
'dataField1' : [1, 2],
'dataField2' : ['blah', 'foo']
}

dataField1 and dataField2 would be the dataIndex fields for your columns. In the renderers then check to see if the value is in the array. If it is show that empty string, if not then add it to the array and display it.