Skip to Content
author's profile photo Former Member
Former Member

Fetch the Values of Cell from i5Grid using cellSelectionEvent ?

I'm trying to fetch the value of the cell on selection using cellSelectionEvent of i5Grid. I have registered my event handler for the cellSelection event and the event handler gets executed whenever any cell in the i5Grid is selected. But i don't find any methods that would fetch me the value of the selected cell in the i5Grid.

As per UI5 conventions, we usually pass an parameter say oEvent to the event handler which would contain the value of the selected cell, but it seems that's not the case with MII i5Grid as the parameter oEvent returns undefined. So what is the way out here to fetch the value of the selected cell ?

i5Grid.registerCellSelectionEvent(function(oEvent){
     alert("cell selection event");
     console.log(oEvent); // undefined;
});

- Sakthivel

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2015 at 03:42 PM

    Hi Sakthivel,

    You can try the following:

    i5Grid.registerCellSelectionEventHandler(function(oEvent){

    alert("cell selection event");

    console.log(oEvent); // Q.Event

    alert("selected cell value is "+Grid.getSelectedCellValue()); //This returns the value in the selected cell

    });

    Please mention the version of MII that you are using.

    Thanks and Best Regards,

    Ria

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sakthivel,

      The method on i5Grid component in 15.0 SP expects the column index and appears to be buggy (I tried with 15.0 SP4 P10) -- doesn't work on first selection and from the next selection onwards return old selection value.

      alert(grid.getGridObject().getSelectedCellValue(grid.getGridObject().getSelectedColumnIndex()));

      The snippet I have mentioned in the previous reply works on 15.1 SP (yet to be in GA).

      Thanks and Best Regards,

      Ria

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.