Add new table column that's left aligned in table - vaadin

We're developing a web application using the Vaadin framework.
In this app I have an existing table with a range a columns. On a user action I want to remove some of the existing columns and add some other additional columns.
This proved quite easy, however, I want the added column to be placed as the first column in the table, on the out most left edge of the table, and I can't seem to find any support for this action. Every column that's added is by default placed as the last column, in the out most right of the table.

What you should do is to set your
table.setVisibleColumns(your sorted order of columns)
and also
table.setColumnReorderingAllowed(false)
it might be good to throw in a force of relaoding the datasource so
table.setContainerDataSource(table.getContainerDataSource());

Related

Is there a way to collapse rows that belong to the same Table in Antd 2.x?

I'm trying to make a row show more information that belong to the same table using antd and react (the data nested still belongs to the table, but it is collapsed) as is shown on image below. Searching on antd table documentation, I found a example to nest another table in the main table. Howerver, the second table also needs to have a Header besides it does not fallow the alignment of the first one. Could someone please explain me how I reach there?
example
antd table example

iOS and SQL issue

I have an app that uses an SQLite database for user choices of backgrounds, icons, fonts, etc. I didn't create it, so, I have to use what I have, as, I have a rather large installed base, and am not inclined to switch to CoreData at this point. Don't want to piss off the current users. I also am not really up to speed on SQLite or CoreData.
I was using a custom grid view to display the backgrounds and icons. All of that has been changed to UICollectionView with a UICollectionViewCell.
In the SQL file, the base set is one table of 16 items. Really two (one for icons and the other for backgrounds). These are a part of the base app. In-app purchasing unlocks other "sets". These other sets are in a second table. Yes, separate tables for icons and backgrounds.
I have changed the ID numbers in the first table to start at 0. Previously they started at 1. I can now select and change both icons and backgrounds at will without issue and get the correctly selected item.
Except... when I select an item that is in the secondary icon or background table.
I have altered the ID numbers in the second table to start at one ID higher than the ending ID in the base set table.
But... the first item in the second table is being skipped. Selection of any item in the second table is showing the icon or background directly prior to the selected item. (ie. I select ID 21, I get ID 20 displayed). The first item in the secondary table is showing the last item in the secondary table.
So, my question... should the IDs in the second table start over at 0? Should they start at 1? Or is there another way to solve the skipping and incorrect selection?
Thanks in advance.

How to add table styles back to table after it has been updated using jQuery Mobile

I create a table dynamically from json data. I then allow the user to update certain elements in the table. Before the update the table looks as follows:
I inspect the element and it has the following:
Then after I update the table, the styles added to the input boxes and selects in the table are removed:
I would like to know, how would I add back these styles (i.e ui-select, ui-btn-inner etc) so that the tables dont lose their styling when I recreate the tables. I want to know how to add back the styles to the select, input and the colour of the "Update TextBooks".
just to shed some more light on the answer so that people understand everything 100%. I was always calling code that basically kept reconstructing the above table, as seen in the pictures above.
In order to keep adding the jQuery Mobile formatting and css to the table everytime one has to call the .trigger() method on the table. So for example I would dynamically create an a table based in the users values entered previously. For this solution lets say my table has an id of id = 'updatetable'.
Thus to fix the above problem simply use:
$("#updatetable').trigger('create');
after you have dynamically created the table.

Items to move up dynamically

If I have a a number of elements in one table column and I drag them one at a time to another column utilizing jQuery UI, how do I make remaining items in the first column move up, i.e. fill the gap left by the items that were moved. Assuming table cell valign="top".
I think it has to do something with DOM. It seems that even after I drag the item is it still in the same column.
You might want to use jquery ui's sortable instead.
http://jqueryui.com/demos/sortable/#connect-lists
You can connect lists and anything moved from one list will move the remaining elements to fill any gaps
However you are not giving us any code/markup to work with so I can only guess. Hope this helps!

How to sort a QuantumGrid on data from a different column

Is there a way to sort Devexpress QuantumGrid rows on data from a different column other than the one whose header has been clicked? For example, when the header of column A is clicked the rows of the grid are sorted on the data from column B. Visually it should still appear that it is column A that has been sorted as the sort glyphys will be shown in column A's header.
#norgepaul you must check the DevExpress Support Center for the questions related to the DevExress products, This site has thousands of answers and articles related to its products.
check theses links
Sorting by other field (when clicking header) in ExpressGrid 6
http://www.devexpress.com/Support/Center/SearchResults.aspx?searchtext=sort&p=T1|P0|83
I don't have DevExpress here to check, but i would look to see if there is a custom sort event. like OnCustomSort, where you get to decide whether a value or cell sorts higher or lower. I think you'll have the ability to know what rows are being compared, so you could look across to B cells, and make your own comparision.

Resources