Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
2 replies
Subscribers
7 subscribers
Views
1204 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Hi Everybody. I have a grid and want to update/manipulate some of its elements
hajii
over 12 years ago
Hi Everybody. I have a grid and want to update/manipulate some of its elements as changes are made by the user to other elements. We use the Advanced Forms Utilities plugin and JS code on grid elements "change" Event Rules for that purpose. For example this code for adding the "num1" and "num2" columns and placing it in "num3" :
var index = window.FormDesigner.lastRowEvent;
var aRows = window.FormAPI.getValue("num1").id.split(';');
var bRows = window.FormAPI.getValue("num2").id.split(';');
var a = aRows[index];
var b = bRows[index];
var c = parseFloat(a)+parseFloat(b);
if ( !isNaN(c) )
{
document.getElementsByName("num3")[index].value=c;
}
This works so long as the user is just adding rows or modifying elements, but when a row is deleted then the "lastRowEvent" references are incorrect and the wrong elements are used as the user makes changes.
How can I reference the row index and elements correctly in all circustamces as the...
OriginalPostID-42448
OriginalPostID-42448
Discussion posts and replies are publicly visible
Parents
0
kumaraveln
over 11 years ago
@hajii - i had a similar problem .. but my logic was to loop through all the elements in the field list so i din care about the row index ..
i tried to call the same manipulation logic from two places .. one from that particular cell "onChange" (which works perfectly when we keep on adding rows) and other when a "Delete row" event takes place (this is for the issue). For the second i placed the below code in form "onLoad":
$(".deleteRowIcon").click(function(){
alert("A row has been deleted");
//Logic goes here\t
});
Although the alert came up, i got a new issue. All rows got deleted instead of the one i tried to delete.
Hope u can explore from this and get some solution.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
kumaraveln
over 11 years ago
@hajii - i had a similar problem .. but my logic was to loop through all the elements in the field list so i din care about the row index ..
i tried to call the same manipulation logic from two places .. one from that particular cell "onChange" (which works perfectly when we keep on adding rows) and other when a "Delete row" event takes place (this is for the issue). For the second i placed the below code in form "onLoad":
$(".deleteRowIcon").click(function(){
alert("A row has been deleted");
//Logic goes here\t
});
Although the alert came up, i got a new issue. All rows got deleted instead of the one i tried to delete.
Hope u can explore from this and get some solution.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data