Hello

We need to select several rows in the grid We are using FOEX grid select row(s) plugin But in the value I can set more than one index value ! how to pass a list of indexes (array)?

Thanks

alt text

asked 17 Aug, 04:08

mosab's gravatar image

mosab
611
accept rate: 0%

edited 17 Aug, 05:00

FOEX-SUPPORT's gravatar image

FOEX-SUPPORT
4.8k15


Currently you can only select a single row, we have filed an enhancement request to update the "Select Row" plugin. In the interim you can add an "Execute Javascript Code" action instead and use the following javascript to achieve your requirement:

var grid = Ext.getCmp('YOUR_REGION_STATIC_ID'),
   rowIndexes = '3,5,7',
   arr = rowIndexes.split(','),
   records = [];

Ext.Array.each(arr, function(row) {
   row = parseInt(row, 10) - 1; // uses a zero based row index
   var record = grid.store.getAt(row);
   if (record) records.push(record);
});
grid.getSelectionModel().select(records);
link

answered 17 Aug, 04:58

FOEX-SUPPORT's gravatar image

FOEX-SUPPORT
4.8k15
accept rate: 32%

edited 17 Aug, 07:49

What does this mean ??

alt text

where put this code ?

link

answered 17 Aug, 06:19

mosab's gravatar image

mosab
611
accept rate: 0%

That is a parsing error, however the code still works in javascript, it's just a coding style to use an expression test to short circuit before performing the 2nd part of the expression if record is not defined. I have amended the original code posted to use an "if" statement instead.

You will put this in an "Execute Javascript Code" action instead of using the "Select Row" action.

(17 Aug, 07:51) FOEX-SUPPORT FOEX-SUPPORT's gravatar image

No effect ... What is meant by "YOUR_REGION_STATIC_ID" ? I used this 'R17689822785031743' and '#R17689822785031743'

(17 Aug, 08:48) mosab mosab's gravatar image

Done >> thanks

(17 Aug, 08:51) mosab mosab's gravatar image

Please ... how to get row index by column value (javascript code) ?

(17 Aug, 09:20) mosab mosab's gravatar image

If you would like to filter by a column value please use the following javascript:

var grid = Ext.getCmp('YOUR_REGION_STATIC_ID'),
   pkIds = '10003,1115,72304',
   arr = pkIds.split(','),
   records;

records = Ext.Array.filter(grid.store.data.items,
   function(r) {
      return arr.indexOf('' + r.get('MY_PK_COLUMN_ALIAS')) !== -1;
   }
);
grid.getSelectionModel().select(records);

Note: we do not support this javascript, it is your responsibility to maintain. We are just providing a guide for you.

link

answered 17 Aug, 10:17

FOEX-SUPPORT's gravatar image

FOEX-SUPPORT
4.8k15
accept rate: 32%

Okay >> please how to call item value in javascript?

(20 Aug, 01:55) mosab mosab's gravatar image

Dear

You can use => $v('PAGE ITEM') to get the value of PageItem,

Ex. var c = $v('P1002_PROFILE_CODE');

or

apex.item( "PAGE ITEM" ).getValue() Ex. alert( "P1_ITEM value = " + apex.item( "P1_ITEM" ).getValue() );

Thanks

(20 Aug, 05:23) SKR SKR's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×556
×34
×23

Asked: 17 Aug, 04:08

Seen: 176 times

Last updated: 20 Aug, 05:23

FOEX Links