how to update the record of Selected row in Interactive Grid - Interactive Grid
how to update the record of Selected row in Interactive Grid ,
In Oracle Forms :- its very easy to achieve the below functionality with help of
/*GO_BLOCK ('TEST');
First_record ;
While system.last_Record <> true loop
if :test.status ='Y' then
update statement
end if;
next_Record;
end loop;*/
First_record ;
While system.last_Record <> true loop
if :test.status ='Y' then
update statement
end if;
next_Record;
end loop;*/
Now see in APEX Interactive GRID
Create Update Button on GRID Region --> Create DA with JavaScript Code
var i, records, record, sal, model,
view = apex.region("emp").widget().interactiveGrid("getCurrentView");
if ( view.supports.edit ) { // make sure this is the editable view
percent = percent / 100;
model = view.model;
records = view.getSelectedRecords();
if ( records.length > 0 ) {
for ( i = 0; i < records.length; i++ ) {
record = records[i];
sal = parseFloat(model.getValue(record, "SAL"));
if ( !isNaN(sal) )
{
sal = sal + sal * percent;
model.setValue(record, "SAL", "" + sal);
or
$s("SAL",sal);
or
apex.item("SAL").setValue(sal);
or
apex.server.process("testValidate",{x01: sal},
}
view = apex.region("emp").widget().interactiveGrid("getCurrentView");
if ( view.supports.edit ) { // make sure this is the editable view
percent = percent / 100;
model = view.model;
records = view.getSelectedRecords();
if ( records.length > 0 ) {
for ( i = 0; i < records.length; i++ ) {
record = records[i];
sal = parseFloat(model.getValue(record, "SAL"));
if ( !isNaN(sal) )
{
sal = sal + sal * percent;
model.setValue(record, "SAL", "" + sal);
or
$s("SAL",sal);
or
apex.item("SAL").setValue(sal);
or
apex.server.process("testValidate",{x01: sal},
}
Comments
Post a Comment