View Full Version : How to Show / Hide cell value on the basis CheckboxSelectionModel ?

28 Feb 2011, 9:57 AM
Hello All,
I have a gridpanel which looks something like this :

So i wanted to know when my grid renders, how can i show/hide the price column cell values on the basis of the "Included ?" selection model.

.x-grid3-row-selected .x-grid3-col-price{
display: block !important;

display: none !important;

.x-grid3-gridsummary-row-inner .x-grid3-col-price{
display: block !important;

The above code does serves the purpose, but i am also using the gridsummary plugin to sum the values which are currently visible.
My question is how do i put this check in the plugin so that after every click, i can check the CSS class of the price cell, and do the calculation accordingly.

My Code in the plugin looks like :

var data = {}, cfg = cm.config;
data["price"] = 0;
for (var j = 0, jlen = rs.length; j < jlen; j++) {
var r = rs[j]; // get a single Record
var cell = myView.getCell(j, PriceIndex);
var el = Ext.get(cell);
console.log("MY STYLE IS *******" + el.isDisplayed());
var notVisible = el.hasClass('x-hidden');
data["price"] = data["price"] + 0;
data["price"] = data["price"] + Ext.num(r.get("Price"), 0);

But not sure how to get he exact CSS for the cell to calculate?

Any advise ?