Last post Nov 25, 2018 06:52 PM by robinwilson16
Aug 27, 2018 05:09 PM|robinwilson16|LINK
I am looking for some advice/confirmation on if my method is the best approach.
I am developing a system in ASP.NET Core to list, insert and edit customers where you can click on one and open them in a popup tabbed interface with customer details on the first tab, addresses on the second, notes on the third etc.
In previous projects I would scaffold the sets of pages for each entity and use jQuery .load to pick up a specific div tag and load this into each tab of the popup passing through the customer id then actions such as inserting an address would load the create
model for this in a second popup and then when saved using XMLHttpRequest would refresh that area of the underneath popup.
Is this the best approach or is there something better? Another option is to load data into iFrames or have a single model that updates all related entities when saving, or maybe something else I am not aware of? As .NET Core is server side I assume it doesn't
support partial page refreshes.
All of these approaches probably have their pros and cons but I know jQuery code can quickly grow to get a bit out of hand and be hard to debug sometimes.
I would be interested to hear how others approach these kinds of tasks.
Aug 28, 2018 12:48 AM|Charles Matvchuk|LINK
Rather than role my own JQuery code and use things like iframes, I would recommend third party grid. There are several out there that are good, but I personally, for ASP.NET Core use DevExpress DevExtreme. What you are asking to do I could do in about
10 minutes with the DevExtreme Grid, set it popup editform mode and I can have tabs on the edit form.
Just a suggestion, no reason to reinvent the wheel. https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/PopupEditing/NetCore/Light/
Nov 25, 2018 06:51 PM|robinwilson16|LINK
Thanks for your reply and sorry it took time to get back to you.
I ended up using jQuery DataTables: https://datatables.net/
I tried querying the data remotely but there was a bit of a delay and I found it handled a large dataset of thousand of rows pretty well and was able to instantly search and switch pages. Also whilst supplying data in JSON seemed pretty easy I could see
supplying it in XML was more complex.
I still ended up having to use Bootstrap Modals and using the on shown function to load in the remote page but I managed to get it a lot cleaner than in the past where the code grew into a bit of a monster!
Here is what it looks like:
Nov 25, 2018 06:52 PM|robinwilson16|LINK
Just thought I had better mention that this is not real customer data.