This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - On Click button on form and refresh grid with current data

Shankar - Saturday, June 25, 2016 6:48 AM:

hello developers,

I have created grid + button on html field and on click event i want to add data from current tab and reload my grid from client side code

function dostandarddetail()

{

 var itemtypeID = top.aras.getItemTypeId("Symbi_PackMaterialRcons_Detail");

 var param = { aras: top.aras, itemtypeID: itemtypeID, multiselect: true };

 var options = { dialogWidth: 700, dialogHeight: 450 };

 //getHeaderForPackRecon();

 var results= top.aras.modalDialogHelper.show('DefaultModal', window, param,  options, 'searchDialog.html');

 

for (var i = 0; i < results.length; i++)

{

var result = results[i];

}

var item = document.thisItem;

var vpack = item.newItem("Symbi_Pack_MterialRecons","add");

var fmi=item.newItem("Symbi_PackMaterialRcons_Detail","get");

fmi.setProperty("id",result);

var resfm=fmi.apply();

 

var vATRPara = item.newItem("Symbi_PackRecons_Detail","add");

vATRPara.setProperty("source_id",item.getID());

vATRPara.setProperty("related_id",result);

vATRPara.setRelatedItem(fmi);

vpack.addRelationship(vATRPara);

var res=vATRPara.apply();

var lstatus=document.thisItem.getLockStatus();

if(lstatus==1||lstatus==2 )

 {

var it= top.aras.saveItemEx(document.thisItem.node,false);

top.aras.uiReShowItemEx(document.itemID,it);

 }

top.aras.work.searchContainer.runSearch();

 alert("test");

 

}

 



edonahue - Thursday, July 7, 2016 6:44 PM:

Hi Shankar,

You can define the onClick event for your button in the HTML field using standard Javascript. In your custom onClick handler, reinitialize your grid control to refresh the display.

Note: Innovator's OnClick Field Events do not work with buttons embedded in an HTML field.