I have 2pages(section1, section2) sharing the same controller. When I enter values in section1, the values are stored in sessionstorage and I'm able to retrive and display it in section2 grid. However, this value does not get stored in the section2 object. I want it to be able to save the values coming from section1 in section2 object so that I can populated a summary page with section1 and section2 values populated in ui-grid. Currently the values in section2 show as empty as its not being saved in the scope object.
Update:
Note this question is more of how to save the data populated(without any user edits) in ui-grid row in a ui-grid way.
ui-grid for section1:
$scope.section1 = {
enableCellEditOnFocus: true,
enableCellEdit:true,
enableSorting: false,
rowHeight:55,
enableHorizontalScrollbar : uiGridConstants.scrollbars.NEVER,
enableVerticalScrollbar : uiGridConstants.scrollbars.NEVER,
columnDefs:[{
field: 'piidata',
displayName:'PII or Firm Sensitive Data'
},
{
field: 'location',
displayName: 'Location'
},
{
field:'risklevel',
displayName: 'Risk Severity Level',
editType: 'dropdown',
enableCellEdit:true,
editableCellTemplate: 'ui-grid/dropdownEditor',
editDropdownOptionsArray: $scope.levels,
editDropdownIdLabel: 'option',
editDropdownValueLabel: 'option'
}],
onRegisterApi: function(gridApi) {
grid = gridApi.grid;
}
};
ui-grid for section2:
$scope.section2 = {
enableCellEditOnFocus: true,
enableCellEdit:true,
enableSorting: false,
rowHeight:55,
enableHorizontalScrollbar : uiGridConstants.scrollbars.NEVER,
enableVerticalScrollbar : uiGridConstants.scrollbars.NEVER,
columnDefs:[
{
field: 'piidata',
displayName:'PII or Firm Sensitive Data',
cellTemplate : '<div >{{grid.appScope.piidata()}}</div>'
},
{
field: 'location',
displayName:'Location',
cellTemplate : '<div >{{grid.appScope.location()}}</div>'
},
{
field:'risklevel',
displayName: 'Risk Severity Level',
cellTemplate : '<div>{{grid.appScope.risklevel()}}</div>'
}
],
onRegisterApi: function(gridApi) {
}
};
Sessionstorage values:
$scope.piidata = function (){
return $sessionStorage.section1.data[0].piidata;
}
$scope.location = function (){
return $sessionStorage.section1.data[0].location;
}
$scope.risklevel = function (){
return $sessionStorage.section1.data[0].risklevel;
}