Replies: 1 comment
-
In RetailSDK that uses IDataListState, the selectionChanged has a bind. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can somebody please let me know how to rebind the lines and payments grid on selection changed in CommerceSDK.
My customer service view is based on the look and feel of the ShowJournalView in standard POS.
It works fine in retailSDK to assign the lines and payment values for the order selected in the main grid.
On RetailSDK we placed the datalist in the Construct to make sure it binds properly.
In CommerceSDK I have to put the datalists in the OnReady. At the end of the OnReady method, there is a “ ko.applyBindings(this, element);”
The above binds the main grid and it binds the side panels.
When I select an order and it runs the logic to pull the lines and payment for the selected order, it does nothing.
When I select another order, then it shows it but it shows the lines and payments of the previous order selected.
I stepped through the javascript compiled code in Chrome debugger and it is populating the data source used by the lines and payments grids. So the problem is that it doesn’t redraw the lines and payment grids.
If this was pure ASP.Net I would have just called the databind-method of the GridView to rebind only the gridView control. However I am working now within the framework of CommerceSDK. So how do I do this rebind. Calling ‘ko.applyBindings(this, element);’ again doesn’t work.
I retrieve the data for the lines and payments grid on the Selectionchanged-eventlistener of the main grid that shows the orders:
` this.dataList.addEventListener("SelectionChanged", (eventData: { items: Entities.SalesOrderTMC[] }) => {
this.viewModel.setSelectedItems(eventData.items);
this.dataListTenders.data = this.viewModel.TenderLines;
this.dataListItems.data = this.viewModel.OrderLines;
this.viewModel.setSelectedItems(eventData.items); - populates the 2 entities used by the lines and payment grids.
Beta Was this translation helpful? Give feedback.
All reactions