sp-model
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 09:03 PM
Can anyone help me in how to pass data to sp-model to populate a form ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 10:01 PM
Hello Kanika,
Assume you have table of incident on a widget every single row contain a incident record and last column contains a button, on which if you click then this will open a sp-model(incident form) to show more detail of that current record.
On click of that button "sys_id" of that row is passed to sp-model or you can say form of incident.
Here is the code please refer.
c.buttonClick = function($index)
{
var sys_id = c.data.array[$index].sys_id;
var table = "incident";
var data = sys_id + "####" + table;
$rootScope.$broadcast('sys_id',data);
}
c.openModal = function() {
c.modalInstance = $uibModal.open({
templateUrl: 'modalTemplate',
scope: $scope
});
}
If my answer was able to solve your query please mark it as Helpful & Correct.
Thank you
Siddhnath Pandey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 10:42 PM
Hey Kanika,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 04:48 PM
Hi siddhnath/Indrajit,
i am looking a way through
<form>
<sp-model form-model="::data.sc_cat_item" mandatory="c.mandatory"></sp-model>
</form>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 11:27 PM
Hello Kanika,
try with this code.
<sp-model form-model="::data.sc_cat_item" mandatory="c.mandatory" id="data.sys_id"></sp-model>
and you have to fetch the sys_id like data.sys_id = gr.getUniqueValue(); from server script.
or as in my reply you would see I am passing the sys_id on click of the button.
If my answer was able to solve your query please mark it as Helpful & Correct.
Thank you
Siddhnath Pandey