Hello all,
I'm trying to interface with some rather antiquated technology, and thus far have been successful. My back-end is RM/COBOL 11. I have a custom library which I pass values in an array to the COBOL programs in which they return an array via delegates.These are passed as Collections via a Web API in ASP.Net 5 using the repository pattern, no IQuerryable. This has worked well for me so far, until i got to detail grids and I'm looking for some direction or options. I am somewhat new to Angular and Kendo UI.
The issue at hand is when I set the datasource on my detail grid everything is fine for single row expansion. But once i bind the next expanded column all prior (still) expanded rows then reflect the calling rows data. I know this is due to way my data is bound to a JSON array and its replaced on the subsequent calls, but my question would be is whats the best way to retain a specific rows data that belongs to it without a query-able datasource? or is my only option to only allow single row expansion? If so can someone point in the right direction on collapsing each prior expanded row before expanding the next?
The detail grid (Party) is looked via the instrument number column value in the main grid. The data in the second expanded party detail overwrites the original data the first expanded row had in it.
Angular Datacontext service
function
getParty(instrument) {
return
$http({
url:
'/api/app/getparty'
,
method:
'GET'
,
params: { instrument: instrument }
})
.then(success)
.
catch
(fail)
function
success(response) {
return
response.data;
}
function
fail(e) {
return
exception.catcher(
"XHR Failed for getParty"
);
}
}
Angular Controller (controller as vm syntax)
vm.detailPartyDataSource = [];
vm.detailPartyOptions =
function
(dataItem) {
return
{
dataSource: {
data: datacontext.getParty(dataItem.documentInstrument).then(
function
(data){
return
vm.detailPartyDataSource = data}),
type:
"json"
},
scrollable:
false
,
sortable:
true
,
columns: [
{ field:
"name"
, title:
"Name"
},
{ field:
"nameType"
, title:
"Name Type"
},
{ field:
"bookPage"
, title:
"Book & Page"
},
{ field:
"docType"
, title:
"Document Type"
},
{ field:
"date"
, title:
"Date"
},
{ field:
"indexed"
, title:
"Indexed"
}
]
};
};