PDA

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



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

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;
}

.x-grid3-col-price{
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');
if(notVisible){
data["price"] = data["price"] + 0;
}else{
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 ?