Page 1 of 1

Display information in the grid

Posted: Sat Jan 16, 2021 9:28 am
by vahid2231
Hi
I have trouble doing this process.
I have two forms, in the first form the information is confirmed or rejected by the manager.
Now in the second form, I want to show the user only the items that have been approved.
Please help me do this. I need a very quick answer.

Re: Display information in the grid

Posted: Mon Jan 18, 2021 2:40 am
by kirkwg
Hi there,

A similar way of doing is shown below, kindly try to rewrite it in order to applying to your grid's case, thanks.
Code: Select all
var grid_1 = [
    ["Yes",20,"Table"],
    ["No",10,"Chair"],
    ["Yes",5,"Phone"] ];
var grid_2 = [];
var len = grid_1.length;

for (var i=0; i<len; i++){
  if (grid_1[i][0]==="Yes"){
    grid_2.push( [grid_1[i][0], 
      grid_1[i][1], grid_1[i][2]]);      
  }
}
console.log(JSON.stringify(grid_2));
//output: [["Yes",20,"Table"],["Yes",5,"Phone"]] 


Re: Display information in the grid

Posted: Mon Jan 18, 2021 6:15 am
by vahid2231
Hi
Thank you for your answer
But unfortunately it did not work
Let me explain again

In this work, a user has a series of information that he must confirm or reject
For example, if there are four rows in the network and two of them are approved
Only these two items should be displayed in the next job

Re: Display information in the grid

Posted: Mon Jan 18, 2021 6:32 am
by kirkwg
Hi,
If Grid1 and Grid2 share the same variable or id, the similar logic that you could hide the whole row with no approval..??

Re: Display information in the grid

Posted: Mon Jan 18, 2021 6:36 am
by vahid2231
Yes, both networks have the same identifiers
But I can not do

Re: Display information in the grid

Posted: Mon Jan 18, 2021 9:40 pm
by kirkwg
Hi there,

Found an example for you, kindly read the link below:
https://www.pmusers.com/index.php/Hide_grid_rows

Reference to/find this JS above mainly to hide a grid row:
Code: Select all
 //subtract 1 from row number because starts counting from zero:
    $("#"+gridId).find("div.pmdynaform-grid-row").eq( rowNo - 1 ).hide();     //i.e. .eq(0) = 1st row, .eq(1) = 2nd row etc.
Other than that you should know the logic how to do, good luck, cheers....