Profound UI Grid-get grid row number on grid double click in javascript
-
- New User
- Posts: 14
- Joined: Wed Feb 26, 2020 4:24 pm
- First Name: Srinivas
- Last Name: Siripuram
- Company Name: UPMC
- Phone: 2015655901
- Address 1: 532 Chatham Park Dr, APT 2A
- Address 2: Pittsburgh
- City: Pittsburgh
- State / Province: Pennsylvania
- Zip / Postal Code: 15220
- Country: United States
- Contact:
Profound UI Grid-get grid row number on grid double click in javascript
Hi,
In JavaScript, I am trying to get selected row number in the Profound Grid when double clicking on the grid row.
Can you please some one help, how to achieve this.
In the Genie designer its automatically giving row number, but i need the selected row number in JavaScript, when grid double click event fired.
Please suggest.
In JavaScript, I am trying to get selected row number in the Profound Grid when double clicking on the grid row.
Can you please some one help, how to achieve this.
In the Genie designer its automatically giving row number, but i need the selected row number in JavaScript, when grid double click event fired.
Please suggest.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Profound UI Grid-get grid row number on grid double click in javascript
I'm not sure that I understand. Could you provide an example that I could try on my own machine to understand better?
-
- New User
- Posts: 14
- Joined: Wed Feb 26, 2020 4:24 pm
- First Name: Srinivas
- Last Name: Siripuram
- Company Name: UPMC
- Phone: 2015655901
- Address 1: 532 Chatham Park Dr, APT 2A
- Address 2: Pittsburgh
- City: Pittsburgh
- State / Province: Pennsylvania
- Zip / Postal Code: 15220
- Country: United States
- Contact:
Re: Profound UI Grid-get grid row number on grid double click in javascript
Hi Scott,
As shown attached screen shot, In Genie designer in onrowdblclick event, I am getting the row number which I have clicked in the grid, so that I am able to get the cell value by using row number.
I am trying to write the onrowdblclick event in javascript, but not finding the way to get the row number dynamically when I clicked on the grid row.
getObj("myGrid").grid.onrowdblclick = function handleRowClick(row, isRightClick)
{
if (!isRightClick) {
var value = getObj("subfile").grid.getCellValue(row, 0);
console.log(Value);
//All customized code goes here
}
I have to pass the row number which I have clicked in the grid. Is there any way to find out the grid row number which is clicked.
Can you please suggest how to get the row number in JavaScript.
As shown attached screen shot, In Genie designer in onrowdblclick event, I am getting the row number which I have clicked in the grid, so that I am able to get the cell value by using row number.
I am trying to write the onrowdblclick event in javascript, but not finding the way to get the row number dynamically when I clicked on the grid row.
getObj("myGrid").grid.onrowdblclick = function handleRowClick(row, isRightClick)
{
if (!isRightClick) {
var value = getObj("subfile").grid.getCellValue(row, 0);
console.log(Value);
//All customized code goes here
}
I have to pass the row number which I have clicked in the grid. Is there any way to find out the grid row number which is clicked.
Can you please suggest how to get the row number in JavaScript.
- Attachments
-
- Grid1.PNG (71.14 KiB) Viewed 5220 times
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Profound UI Grid-get grid row number on grid double click in javascript
You posted the following code that doesn't make sense to me:
This seems nonsensical. You can't just attach an "onrowdblclick" field onto the grid object and expect the code in the grid to run it when you want it to. Can you explain why you are doing this?
Code: Select all
getObj("myGrid").grid.onrowdblclick = function handleRowClick(row, isRightClick)
{
if (!isRightClick) {
var value = getObj("subfile").grid.getCellValue(row, 0);
console.log(Value);
//All customized code goes here
}
-
- New User
- Posts: 14
- Joined: Wed Feb 26, 2020 4:24 pm
- First Name: Srinivas
- Last Name: Siripuram
- Company Name: UPMC
- Phone: 2015655901
- Address 1: 532 Chatham Park Dr, APT 2A
- Address 2: Pittsburgh
- City: Pittsburgh
- State / Province: Pennsylvania
- Zip / Postal Code: 15220
- Country: United States
- Contact:
Re: Profound UI Grid-get grid row number on grid double click in javascript
Hi Scott,
I am sorry, if i am not clear, i am trying to write grid row click functionaliy in javascript, for that i need, grid row number which is clicked
by the user.
In the below sample code i am passing the grid row number as 2 (hard coding the row number). Which is working fine when i click on the grid row, but i am
trying to get the grid row number which is clicked dynamically. Is there any way to get the row number in JavaScript. Please suggest.
getObj('subfile').addEventListener('click', function(){
var rowOffset = 5;
var screenRow = 2 + rowOffset;
console.log(2);
changeElementValue('I_' + screenRow + '_13','1');
environment = getObj("subfile").grid.getCellValue(2, 1);
envDesc = getObj("subfile").grid.getCellValue(2, 2);
pui.setCookie("ENV",environment);
pui.setCookie("ENVDESC", envDesc);
});
I am sorry, if i am not clear, i am trying to write grid row click functionaliy in javascript, for that i need, grid row number which is clicked
by the user.
In the below sample code i am passing the grid row number as 2 (hard coding the row number). Which is working fine when i click on the grid row, but i am
trying to get the grid row number which is clicked dynamically. Is there any way to get the row number in JavaScript. Please suggest.
getObj('subfile').addEventListener('click', function(){
var rowOffset = 5;
var screenRow = 2 + rowOffset;
console.log(2);
changeElementValue('I_' + screenRow + '_13','1');
environment = getObj("subfile").grid.getCellValue(2, 1);
envDesc = getObj("subfile").grid.getCellValue(2, 2);
pui.setCookie("ENV",environment);
pui.setCookie("ENVDESC", envDesc);
});
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Profound UI Grid-get grid row number on grid double click in javascript
In your screenshot where you coded the 'onrowdblclick' property of the grid widget, you are doing this the correct way.
Can you explain why that method doesn't work for you?
Can you explain why that method doesn't work for you?
-
- New User
- Posts: 14
- Joined: Wed Feb 26, 2020 4:24 pm
- First Name: Srinivas
- Last Name: Siripuram
- Company Name: UPMC
- Phone: 2015655901
- Address 1: 532 Chatham Park Dr, APT 2A
- Address 2: Pittsburgh
- City: Pittsburgh
- State / Province: Pennsylvania
- Zip / Postal Code: 15220
- Country: United States
- Contact:
Re: Profound UI Grid-get grid row number on grid double click in javascript
Hi Scott,
The way which i mentioned in the screen shot is working perfectly fine. That is from Genie designer, which is specific to one grid.
But we have more than 500 grids, for each grid we have to go and write the onrowdblclick code which is time taking, so we are looking the way
we can write a JavaScript function and we can call it on grid row double click. But here the challenging thing is getting the grid row number in JavaScript when the user clicks on grid row.
Please suggest,if is there any api available to get the grid row number when the user clicks on grid row in JavaScript.
The way which i mentioned in the screen shot is working perfectly fine. That is from Genie designer, which is specific to one grid.
But we have more than 500 grids, for each grid we have to go and write the onrowdblclick code which is time taking, so we are looking the way
we can write a JavaScript function and we can call it on grid row double click. But here the challenging thing is getting the grid row number in JavaScript when the user clicks on grid row.
Please suggest,if is there any api available to get the grid row number when the user clicks on grid row in JavaScript.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Profound UI Grid-get grid row number on grid double click in javascript
What I would do is write a JavaScript function and link it into the Genie skin's start html (by adding a <script> tag to the start.html).
Then, for each screen, all you need to do is change the "onrowdblclick" property so that it calls that function.
Then, for each screen, all you need to do is change the "onrowdblclick" property so that it calls that function.
-
- New User
- Posts: 1
- Joined: Tue Feb 04, 2020 12:04 pm
- First Name: shivateja
- Last Name: pasham
- Company Name: upmc
- Contact:
Re: Profound UI Grid-get grid row number on grid double click in javascript
So as per understanding, there no possible way to get row number from JavaScript, with click functionality?
Do we need to handle that in Genie designer only? to have access to row number?
Do we need to handle that in Genie designer only? to have access to row number?
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Profound UI Grid-get grid row number on grid double click in javascript
No... that's not true. Getting the row number is easy, it is provided to you in a variable named 'row' if you're using the proper events provided by Genie.PASHAT8046 wrote:So as per understanding, there no possible way to get row number from JavaScript, with click functionality?
However, this is not possible:
Code: Select all
getObj("myGrid").grid.onrowdblclick = function...
In this example, he also tried to use a DOM event rather than a Genie one:
Code: Select all
getObj('subfile').addEventListener('click', function(){
...
So the problem was never getting the row... the problem was a poor understanding of how grids and Profound UI works.
Its not clear why you'd want to do this. Are you trying to apply this double click to every single grid without ever having to open it up in the Genie designer?PASHAT8046 wrote:Do we need to handle that in Genie designer only? to have access to row number?
I think that's possible to do, but I've never heard of someone doing it before and I haven't tried it myself.
Who is online
Users browsing this forum: No registered users and 0 guests