Click here to Skip to main content
15,877,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a matrix build up from patients and employees.
The user can add / remove these patients (columns) and employees (rows) as he wishes.

The problem I have is getting the cell's (who are combobox's with codes depending on the employee) to update correctly.

If the user adds a employee (row) there isn't a problem since all cells have the same list off codes (and adding a row isn't hard)

But if the user adds a patient (column), each row (can) have a different list off codes, so I need to get these from the server.
And adding a column without rebuilding the entire table isn't easy.

So far there have been 2 attempts at getting this to work correctly (by 2 separate (ex) colleague's), both require extensive javascript code and both have problems.
Either the list of codes is wrong, or adding a row / column to the matrix is extremely slow.

I'v tried googling this but so far haven't found anything useful.

So I was wondering if anyone has done this before, or can point me to a article that could help in getting this to work correctly.
I'v already proposed to change the screen layout so that I wouldn't have to dynamically build and load this matrix but the client doesn't seem happy with that (one extra click seems to be to much)
I could make it so that there is a postback to the server after each add of a employee / patient but that will then be a (big) performance hit, and I'm sure that won't go over well either.

Any help would be appreciated.
Updated 5-Nov-14 0:11am
BillWoodruff 6-Nov-14 5:46am    
I think more details would be helpful here. Ideally, all the data and their inter-relationships should be managed in the Model, and the View(s) should be constructed/refreshed via re-rendering them from the Model data via code in the Controller.

Not clear what the UI representation is here: includes a DataGrid ? Only ComboBoxes ?
Tom Deketelaere 6-Nov-14 5:57am    
I follow you on the views should be constructed / refreshed via re-rendering them. That's why I don't like the current implementation that does everything in javascript (and because it's buggy at best).

The UI representation is relatively simple.
Imagine a table where the cells only contain a combobox, and you have to be able to add/remove both rows and columns.
There is no Datagrid or anything else in it.
something like this (a bit hard to do in just text but ...):

button add row
button add column
button remove row
button remove column

I can do it (with ease) if I do a refresh of the view after each click on a button, but the client doesn't really like that solution (if I don't find anything better he will have to deal with it but wanted to see if there wasn't a better way)
Nathan Minier 6-Nov-14 9:30am    
Is there a compelling reason that you couldn't tuck the grid into a PartialView and call it via AJAX, so that a full POSTBACK wouldn't be required?

The other option is to find someone who is good at Single-Page Application frameworks (like Angular) and get a solid implementation in place that doesn't build on buggy script.
Tom Deketelaere 6-Nov-14 9:37am    
The partialview option is something I'v been considering (but due to the complexity of the screen, this matrix isn't the only thing on it, isn't easy, yet not impossible). Though the client was pretty specific that he doesn't want the entire matrix to reload every time and with this I'd still have to do that.
I'm fairly certain that there is no other (clean and good) way to do it but since front end development isn't my strongest asset I did want to see if I wasn't missing something.
Nathan Minier 6-Nov-14 10:17am    
No, you're not missing anything. If the customer is presenting those constraints then you are stuck with JavaScript, there's just no way around it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900