<style> .selectClass { background-color: #1f7499 !important;/*default selection color of the grid in flat-azure theme*/ color: white !important; } </style>
<script type="text/javascript"> $(function () { $("#Grid").ejGrid({ // the datasource "window.gridData" is referred from jsondata.min.js . . . selectionSettings: { selectionMode: ["cell"], enableToggle: true }, selectionType: "multiple", . . . . //for removing the class when enable toggle is set as true recordClick: function(e){ if (e.model.selectionSettings.enableToggle && !$(e.cell).hasClass("e-cellselectionbackground")) $(e.cell).removeClass("selectClass"); }, //adding the class to the cell on selection cellSelected: function (args) { if ($(args.currentCell).hasClass("e-cellselectionbackground")) $(args.currentCell).addClass("selectClass"); } }); });
|
Hi Ragavee,
Thanks for the snippet.
I try it but don't work well as i want. This example only work if i have the toggle option for selection. What i want is show the selected cell or multiple cells when use the ctrl key for select and deselect all other cells when i select an individual cell.
However i get an solution using the next snippet.
<style>
.e-cellselectionbackground {
background-color: #1f7499 !important; /*default selection color of the grid in flat-azure theme*/
color: white !important;
}
</style>
Sorry if i don't explain well on first time.
Many thanks, Regards
CS