Piorun Posted August 1, 2013 Share Posted August 1, 2013 Hi guys. Here i show you code: addEventHandler("loadTableColumns", root, function(columnTable) if #adminpanel.databasegridlist.column > 0 then for i=1,#adminpanel.databasegridlist.column do guiGridListRemoveColumn(adminpanel.databasegridlist[1], adminpanel.databasegridlist.column[i]) table.remove(adminpanel.databasegridlist.column, i) end end for _, column in ipairs(columnTable) do adminpanel.databasegridlist.column[#adminpanel.databasegridlist.column+1] = guiGridListAddColumn(adminpanel.databasegridlist[1], column.name, 0.1) end end) Problem is that this function "guiGridListRemoveColumn" doesnt work correctly. It remove only 2 first columns (but it returns number of removed columns correctly). columnTable is column from "PRAGMA table_info(...)" so it returns columns of database. Columns in gridlist are added fine. Help pls . Link to comment
Castillo Posted August 1, 2013 Share Posted August 1, 2013 I don't really understand the problem. Link to comment
Piorun Posted August 1, 2013 Author Share Posted August 1, 2013 Step by step: 1. I have gridlist. 2. Using some table i want to add columns which names are same as names in this table. 3. For ex. table have 13 elements and 13 columns are added to gridlist. 4. After that i want to delete those columns from gridlist (all) - when i check (outputChatBox(tostring(guiGridListRemoveColumn...))) function corectly removing 13 columns (result - 13 times "true") but only 2 are really removed. What's wrong (and this is this code)? Link to comment
Castillo Posted August 2, 2013 Share Posted August 2, 2013 I've just read on the wiki this: guiGridListAddColumn returns wrong index after deleting columns Link to comment
Piorun Posted August 2, 2013 Author Share Posted August 2, 2013 So i must delete parent gridlist to work correctly? @EDIT ok anyway i'll try to do something. Thanks a lot Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now