hammies
hammies

Reputation: 1435

Merge two data in one row cgridview yii

Is there a way to merge two data in one row? I have a gridview, within it, there are products that can be sold as a bundle. If I have it as it is right now, the user can delete one of the product bundle, and still receive a bundle price. That's not good. So how can I merge the two rows into one?

Or is it possible to add a row that indicates that the following two rows are a bundle? See picture, where there's an extra row. My other thoughts are having a cgridview in a cgridview?

My database has a column that indicates whether the product is a bundle or not. Let me know if there are any information needed.

enter image description here

Upvotes: 0

Views: 639

Answers (2)

Developerium
Developerium

Reputation: 7265

you can also use CListView for custom view and also having filters and sorts.

for creating custom html based on dataproviders, I think it's the best solution, since you only care about the layout and yii provides the data.

Upvotes: 1

Mihai P.
Mihai P.

Reputation: 9357

You are over complicating things I believe. Why not just create the html yourself? that would be the easiest solution by far.

If you really want to do what you want then you have to extend cgridview and create some rendering yourself.

If you really want to go that route then try to study this http://yiibooster.clevertech.biz/extendedGridView#groupgridview some of the features are almost exactly what you need.

Upvotes: 0

Related Questions