This is a migrated thread and some comments may be shown as answers.

Grid using templates

2 Answers 203 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 09 May 2012, 03:25 PM
Hi
I'm trying to use mvvm and templates to produce a grid with column totals. A fairly simple scenario I think. I can get the grid to render and the column footer to show. However, I no longer have the ability to edit the grid cells (due to the row template that I am using). What can I do to make the rows function as if I was not using the template, and binding the products list to the table instead. Or can I just bind to the table and somehow have a custom footer that I can use to bind to my view-model with calculated totals. BTW I can just use a datasource and "sum" aggregate as I want to do some "math" to produce the total.
I have a jsfiddle of the scenario.
http://jsfiddle.net/darrenarbell/K9tnS/26/

Thanks in advance

Regards

 

2 Answers, 1 is accepted

Sort by
0
Darren
Top achievements
Rank 1
answered on 11 May 2012, 11:25 AM
Hi
Replying to my own post. I'm a bit disappointed I haven't got a reply of some shape or form. I have come up with a work around that I am nearly happy with. I have opted for a second table to act as the footer for my totals, in some ways this may even be a better result. The only part I am not happy about is having to explicitly specify the column widths in the css, as number of columns grow, this will get very messy. Id rather specify the with id the (master) grid and somehow pick this up in the footer. I tried using javascript(jquery) but the result was very jerky and no where near as smooth as the css version. Any thoughts, suggestions, improvements would be gratefully received.
http://jsfiddle.net/darrenarbell/vzgep/

Regards
Darren
0
Accepted
Iliana Dyankova
Telerik team
answered on 11 May 2012, 04:35 PM
Hi Darren,

It is good to hear that you have your application working. As another approach I would suggest instead of binding your Grid to the MVVM, to use a footerTemplate. In this template you could call a function which implements the custom logic you need. Please check this forum thread - I believe you might find it very useful.

 

Greetings,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MVVM
Asked by
Darren
Top achievements
Rank 1
Answers by
Darren
Top achievements
Rank 1
Iliana Dyankova
Telerik team
Share this question
or