Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
CraigO

New Member
Registered:
Posts: 6
Reply with quote  #1 

So I have an editable grid in 7.6.4 and I have added an insert button that works properly.  (As does the insert key.)   There are a lot of rows in the grid (more than can be displayed without scrolling), and the problem is that the inserted row does not seem to get focus visibly on the screen.  The grid does not scroll down to the bottom row and show the cursor in the first column of the inserted row.  If I start blindly typing, it works as it should and shows me what I have started typing, so the focus is indeed in the right place, it is just not showing it to the user upon insert.  I have even tried calling a function to select the last row of the grid.  It does but exhibits the same problem so is unnecessary.

The curious thing is, that if I add a debugging alert message to the insert function, it works perfectly.  However I would like it to work perfectly without throwing in some extraineous alert popup.

Here is the code I am using (borrowed from these forums):

Quote:
function RowInsert(aGrid)

{

var LeworkGrid = eworkData.FieldByName(aGrid);

if(LeworkGrid.AllowInserts && LeworkGrid.IsCurrentRowComplete())

{

if(LeworkGrid.State != dsInsert)

{

DeletingRecord = false;

LeworkGrid.Dataset.AddNew();

event.srcElement.blur();

event.returnValue = false;

}

}

}


Can anyone think why the insertion of an alert popup causes it to work correctly and display the inserted row and cursor?  If so, any way I can get around using the alert?

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
If you have not tried it, have a go with the insert buttons in our common library available for download here:
http://processmapping.com.au/freestuff/metastormbpm7giveaway/index.html

In my experience it has always created the new row and passed focus to it. You may have to place the button before or after the grid in the tab order to make that work, however (it has been a while since I used it).

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
CraigO

New Member
Registered:
Posts: 6
Reply with quote  #3 
Thank You, but the buttons from the library are behaving in the exact same way as my own insert and delete buttons, in that the insert does insert the row and seems to have focus but is not displayed until the user starts typing in it, or scrolls down to view it (even if the grid was pre scrolled down to the bottom before the insert takes place, the inserted row is inserted below the visible rows of the grid and the user has to scroll down again to see it.  (making it look at first like the insert did not work)  I have tried putting the buttons in the tab order both before and after the grid.  Still no joy.
0
CraigO

New Member
Registered:
Posts: 6
Reply with quote  #4 
I was able to resolve this issue after much trial and error.  The solution is to add the following code at the end of the InsertRow function:

Quote:
var oGrid = eworkData.FieldByName(sGridName);
oGrid.FocusCurrentRow();
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!