We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Condition format and cell selection

Thread ID:

Created:

Updated:

Platform:

Replies:

119666 Jul 20,2015 06:12 PM UTC Jul 27,2015 01:08 PM UTC JavaScript 3
loading
Tags: ejGrid
Carlos Sereno
Asked On July 20, 2015 06:12 PM UTC


Hi all,

I have implemented something like condition format on a grid using the queryCellInfo with the possibility to select multiple cells at same time. 

At this moment I'm having trouble when select the "painted" cells. The cells are selected but I can't see the selection color.

I already try check some arguments on queryCellInfo but this event don't fire when i select cells.

How I can workaround this?

Many thanks in advance.

Regards,  

Ragavee U S [Syncfusion]
Replied On July 21, 2015 09:36 AM UTC

Hi Carlos,

Thanks for your interest in Syncfusion products.

We have analyzed your requirement and thus prepared a solution to achieve your requirement. Please refer the below code snippet.

<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");                   

                }

            });          

        });      


    </script>


In the above snippet, we have applied the default selection color to the selected cell thus overriding the “painted” cell color in the cellSelected event of the grid.

For your convenience, we have created a sample with the above solution and the sample can be downloaded from the below location.

Sample Link: http://www.syncfusion.com/downloads/support/forum/119666/ze/Sample1544948539

Please get back to us if you need any further assistance.

Regards
Ragavee U S

Carlos Sereno
Replied On July 23, 2015 02:37 PM UTC

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



Alan Sangeeth S [Syncfusion]
Replied On July 27, 2015 01:08 PM UTC

Hi Carlos,

Thanks for the update.

We are happy to hear that your requirement has been achieved.

Please let us know if you need any further assistance. We will be happy to help you out.

Regards,
Alan Sangeeth S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;