Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
835
cellClick event conflicts with startEditTriggers event in grid Updating feature
posted

When I DOUBLE CLICK on the grid, both my cellClick and grid Update window pop up. It seems they are conflicting with each other.

Please look at my startEditTriggers event as well as my cellClick event below.

If someone could please explain why they are conflicting, or perhaps where my mistake is - I would appreciate it

EX/

$("#accountsGrid").igGrid({
            autoGenerateColumns: false,
            dataSource: jsonData,
            columns: [
                { headerText: "Member", key: "entityName", dataType: "string", width: "100px" },
                { headerText: "Margin", key: "Margin", dataType: "number", format: "double", width: "120px" },
                { headerText: "Lookback Interval (D)", key: "LookbackInterval", dataType: "number", format: "number", width: "180px" },
                { headerText: "Confidence Interval", key: "ConfidenceInterval", dataType: "number", format: "percent", width: "150px" },
            ],
            primaryKey: "entityName",
            features: [
                {
                    name: "Sorting", type: "local"
                },
                {
                    name: "Updating",
                    editMode: 'rowedittemplate',
                    startEditTriggers: "dblclick",
                    rowEditDialogContainment: "window",
                    columnSettings: [
                        {
                            columnKey: "entityName",
                            readOnly: true,
                        },
                        {columnKey:"margin"},
                        {
                            columnKey: "ConfidenceInterval",
                            editorType: "percent",
                            validation:true,
                            editorOptions: { button: 'spin', required: true }
                        },
                        {
                            columnKey: "LookbackInterval"
                        }
                    ]                    
                }
            ],
            cellClick: function (evt, ui) { DisplayAccountDetails(evt, ui); }
        });

Thanks in advanced.

Bob

Parents
  • 24671
    Suggested Answer
    posted

    Hey Bob,

    cellClick is independent of updating and will always fire no matter how Updating is configured. The issue is that dblclick fires after click, so basically the order of the events is the following:

    mousedown

    mouseup 

    click => this is where cellClick gets fired

    dblclick => this is where the pop up dialog gets opened

    What you can do is set a timeout in the click event handler, something small, like 200ms, and when the code executes you can check if a dblclick has occured (you can set the flag by handling the rowEditDialogOpening event for the Updating feature). So if dblClickFired = true (this is just a name for the flag i picked), then you won't call DisplayAccountDetails(). You will also need to set the flag again to false in order to reset it for the next interaction. 

    Let me know if this helps. 

    Thank you

    Angel

Reply Children
No Data