FlexGrid error manipulating events

Posted by: pedro.nametala on 26 April 2018, 2:51 pm EST

    • Post Options:
    • Link

    Posted 26 April 2018, 2:51 pm EST

    Hi All,

    I’m facing a problem with Wijmo FlexGrid. I developed my own undo code (based on the same Flexsheet behaviour) but for one specific case is not working properly.

    My grids have the new entry row added at the bottom.

    When I select all rows and press Del, to clear the values, the following error is being caught: “Cannot read property ‘dataItem’ of undefined”@ selectedItems (wijmo.grid.js:13)

    The main reason is because the code is trying to retrieve the value of an empty row

    
    for(var e=this.selectedRows,t=0;t<e.length;t++)e[t]=e[t].dataItem
    
    

    This is preventing my code to continue.

    Also, I have another problem: assuming this bug works, still, using Del to clean the values do not trigger the rowEditStarted event, but triggers the rowEditEnded. Seems to be a bit silly, because it fires the cellEditStarted (but I can’t use this one).

    Do you have a reason for not trigger both?

    Thanks,

  • Posted 29 April 2018, 8:05 pm EST

    Hi Pedro,

    You may avoid it by adding condition if ```

    flex.rows[index].dataItem!==undefined

    
    Blog: https://www.grapecity.com/en/blogs/easy-undo-redo-for-html-forms
    Sample: http://demos.wijmo.com/5/PureJS/UndoStack/UndoStack/
    Source: http://demos.wijmo.com/5/SampleExplorer/SampleExplorer/Sample/UndoStack/PureJS/Code
    
    ~Manish
  • Posted 15 October 2018, 8:10 am EST

    I recommend put the source and sample together in the jsfiddle etc. I noticed there are so many example useful to thousands of people just everything is scatter different framework (angular,js, react) different version(angular1, angular2…) and different type of example(jsfiddle, wijmo, or vs project) I guess you have limited resource so just dump everything in the forum but I hope you can clean up in the feature.

  • Posted 15 October 2018, 3:11 pm EST

    Thanks for the suggestion, we have forwarded it to the concerned team.

    ~Sharad

  • Posted 15 October 2018, 3:33 pm EST

    Hi Koizumi,

    Further, we also have following Sample Collection named Sample Explorer. Please go through the following link:

    http://demos.wijmo.com/5/SampleExplorer/SampleExplorer/Search

    Here, you may get all the samples here.

    We also have a demo sample with jsfiddles collection for various operations. Please go through,

    https://demos.wijmo.com/5/PureJS/LearnWijmo/LearnWijmo/

    You may also get useful information from our blogs:

    https://www.grapecity.com/en/blogs/tags/wijmo

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels