cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

About the table control

pzorrilla
Newbie

About the table control

Hello everybody, masters and amateurs 😃

Ok, so I've been working with tablecontrols in XUI, however I haven't
found relevant information about their management quite easily, my
current problem now is related with delete or update one element in a
Table, let's say that I have the following tablecontrol:

<tablecontrol columns="2" fontweight="bold" foregroundcolor="#85002A"&lt;br"/>gridlines="false" height="200" id="table_results" resize="width">
<header id="encabezado">
<column id="topic" label="Topic"/">
<column id="value" label="Percentage"/"></header>
</tablecontrol>

And that i need to insert some values and then delete them, my current
process in order to insert elements in the table is the following:
dlgitem_insert_list_at($main::ENV['WALKING_WINDOW'],'table_results',1,"value");
dlgitem_set_table_cell_at($main::ENV['WALKING_WINDOW'],'table_results',1,1,"Task");
dlgitem_set_table_cell_at($main::ENV['WALKING_WINDOW'],'table_results',1,2,"20%");
dlgitem_insert_list_at($main::ENV['WALKING_WINDOW'],'table_results',2,"value");
dlgitem_set_table_cell_at($main::ENV['WALKING_WINDOW'],'table_results',2,1,"Concept");
dlgitem_set_table_cell_at($main::ENV['WALKING_WINDOW'],'table_results',2,2,"50%");

I must confess that I'm not pretty sure is this is the best way to do
it, however I didn't find any other fashion to accomplish my goal, I
detected that if I only call the dlgitem_set_table_cell_at() command
without the dlgitem_insert_list_at() first, then my data is not inserted
😞 I would really appreciate if someones could explain me why this
happens. Then, I'm trying to delete the elements in the table, however
something really strange is happening, I have used the
dlgitem_remove_table_row_at() command and the dlgitem_remove_list_at()
command, but both of this methods do not delete all the rows, I think
that the row which can not be deleted is a "selected" row, so I'm
supposing there's a kind of special feature which I must to detect or
disable. Please if anybody has a wide experience using tablecontrols I
would really appreciate your time, help and support.

Best Regards
Paulette Zorrilla

Tags (2)
2 REPLIES 2

RE: About the table control

Just to clarify... about my selected row hypothesis in order to delete one, I have tested mydlgitem_remove_list_at() without select any row and I still can not delete all of them. Please help me! 😄



Paulette Zorrilla

RE: About the table control

I want to share with you guys mi resolution about this problem, my big mistake was that I didn't consider the following: once i delete a row, i have to update my indexdes in order to delete the remaining rows, and since I had an index which I was incrementing to delete the consecutive rows, my index was increasing while my list was decreasing, at the end my last calls to delete some rows didn't work because that rows didn't exist anymore, here's my code about how I solve this problem.


local rows = dlgitem_get_table_row_count($main::ENV['WALKING_WINDOW'],"table_results");


local i=1;


for(j=1;j<=rows;j++){



}


Regards!


Announcements