Last post Jan 22, 2020 12:22 PM by MVC_user
Jan 21, 2020 01:32 PM|MVC_user|LINK
This is my Model:
private void SetDataTable(List<Palermo.Entities.PalermoContentChannel.CategoryContentChannel> Items)
foreach (var item in Items)
var row = this.DataTable.CreateRow();
row.AddAction(new DataTableActionModel("Accion", "Item/" + row.Id, false, true));
row.AddAction(new DataTableActionModel("Test", "Item/" + row.Id, false, true));
As you can see what this metod receives is a List Of Categories (with some ID, text description, etc).
What is doing is setting the table rows for each item.
and im adding some Actions wich work as buttons to call some View.
That works fine, but i dont want to have two buttons on every row. (Accion/Test) i need to display the actions as another table maybe, or a list of options when button is clicked.
I mean... the user click on actions and that display option buttos such as "Edit", "Create", "Delete" (that will call the specific method, action or view).
Jan 22, 2020 05:38 AM|jiadongm|LINK
Can this function create a table, are these classes and methods defined by yourself? Maybe you can provide us more information.
Jan 22, 2020 12:22 PM|MVC_user|LINK
Yes, im based on an Oracle Api call where user id and session are validated, this compare two ids wich will be used on an extra foreach statement (triggering every ActionResult).
So basically we dont have access to see how works that ActionListConfiguration and we will not re-use that code.
As a solution tryed to instance a new object for the two lists (id comparations) but that is really complex because you need to instance a list inside a list and then comparare adding the Buttons as another list table after the first table is shown. (Also
hardcoding values wich is not so great if we consider that we should use a real entity for this site and not a call to Oracle to use one of their entities).
I know sound really messy. But we will use another kind of menu and we will show only two buttons (separatelly) wich make everything more easy... Similar to the original posted code and its working fine.
Thanks for your help!