cancel
Showing results for 
Search instead for 
Did you mean: 

i5Grid getSelectedCellValue() gives incorrect values after filter or sort.

Former Member
0 Kudos

Hi Experts,

I have a few i5Grids with the selection envent enabled.

the grid has the selection event enabled. Whcih works fine on the grid as is.

But if the user filters or sorts the rows and selects the values, the select cell value returns the values of the rows that were originally in that position.

Eg:

In the original grid I have 40 rows with where the row I am looking for is in the 20th position and a random row at third position.

I filter/sort the row so that the 20th row now moves to the third position.

Now when I select the 20th row which is now on the third position, The values returned by the selection event are of the original third row before sorting.

But I expect to get values of the 20th row which has now moved to third position.

Please help. I am using MII 14.0 SP05

Regards

Maaz

Accepted Solutions (1)

Accepted Solutions (1)

swaroop_anasane
Active Contributor
0 Kudos

Hi Maaz,

Also, this looks like something to do with the sequencing of the code. Can you share the code piece.

Thanks,

Swaroop

Former Member
0 Kudos

Hi Swaroop,

The code piece is quiet big but to summerise I have a

grdLoadDtls.registerRowSelectionEventHandler(fnLoadSltd);

and the function has operations like

  DrpDnPONum.setSelectedKey(grdLoadDtls.getGbject().getSelectedCellValue(11));
RfrshMatGrd=0;
  venDef = $.Deferred();
  DrpDnPONum.fireChange('');
  venDef.done(function(value) {
    DrpDnVendor.setSelectedKey(grdLoadDtls.getGridObject().getSelectedCellValue(12));
    DrpDnVendor.fireChange('');

and a lot more.

All the operations are performed perfectly when the rows are unsorted/not-filtered.

Once re-ordered, it still performs all the operations correctly as there are no errors.

But the selected row is according to the original row positions in the grid, not the new ones after the sort/filter.

So the vales populated in the fields below the grid are not from the row that is selected on the grid. But the row that was originally in that position before sort/filter.

Regards

Private_Member_14935
Active Participant
0 Kudos

Hi Maaz,

After you do a default table sort/filter the data model bound to the i5Grid remains the same as per i5Grid js library and hence the value that you get on calling the getSelectedCellValue() is incorrect.

This needs a fix in the i5Grid JS Library.

Best Regards,

Ria

Answers (4)

Answers (4)

swaroop_anasane
Active Contributor
0 Kudos

Hi Maaz,

I second Ria here. I was trying to get something by which we can impose 2 way binding on i5grid's model but could not get anything as such.

Please raise a ticket and do let us know about further proceedings.

Warm Regards,

Swaroop

Former Member
0 Kudos

Hi Ria,

Thanks, I am trying to get a ticket raised. Facing delays due to the holiday season in Middle East

Hi Swaroop,

     I am using the filter and sort functionality available on clicking the column header.

     Yes post sort I need the right values on selection.

  var addProps = '{'+

  '"DisplayTemplate":"<Path to template>",'+

  '"QueryTemplate":"<Path to query>",'+

  '"DisplayColumns":"<Cols>",'+

  '"ColumnWidths":"<Widths>",'+

  '"ColumnHeadings":"<Headings>",'+

  '"ColumnAlignments":"<Alignments>",'+

  '"Content-Type":"image/png"'+

  '}';

  var grdLoadDtls = new com.sap.xmii.grid.init.i5Grid(

    '<Path to template>',

    '<Path to query>',

    addProps

  );

  grdLoadDtls.setGridWidth("100%");

  grdLoadDtls.setGridHeight("100%");

  grdLoadDtls.registerRowSelectionEventHandler(fnLoadSltd);

grdLoadDtls.getQueryObject().setParameter("Param.1", param1);
grdLoadDtls.getQueryObject().setParameter("Param.2", param2);
grdLoadDtls.getQueryObject().setParameter("Param.3", param3);
grdLoadDtls.getQueryObject().setParameter("Param.4", param4);
grdLoadDtls.getQueryObject().setParameter("Param.5", param5);

grdLoadDtls.update(update);

swaroop_anasane
Active Contributor
0 Kudos

Hi Maaz,

I wanted to see the portion where you are loading the data. i Guess you are using default function for sorting!!

You would want to see values updated when a cell is selected post sort right.

Warm Regards,

Swaroop

Private_Member_14935
Active Participant
0 Kudos

Hi Maaz,

From your above description it does look like an issue/bug. You should open a ticket with SAP to get this fixed.

Thanks and Best Regards,

Ria