jquery mobile table - detect change in select - jquery-mobile

My table contains a column that contains a "select".
I need to detect when the user changes the "select" value of the cell so I can make DOM changes to other cells in the row.
I have no idea how to detect that event.

Figured it out.
Added an onchange to the html <td>.
Thanks;

Related

Angular UI-grid, how to tell what the next column in the scroll is

I have a ui grid that has 20 columns, and I would like to be able to tell what the next column will be as I scroll through the horizontal axis so that I can have some text that will tell the users what the names of all the columns they can't see are.
Anyone know if this is possible? As I watch the the inspector and scroll through the columns, I see html attributes changing.
---UPDATE 1----
This is what is all looks like (where it says "home #" is dynamic and will change to show the next column that is out of site)
Based on the ui-grid configuration that you use to render the grid, you already know the order of the columns. You can use this information together with the visible on each column added by the gird itself.
What you need to do is bind a event handler on scroll to iterate over the columns on each change and check the visibility of them. Then the first one with visible === false is the upcoming.
Here is a working Plunker where is used this flag.

How to select just one row, prevent to unselect item in singleselect mode

My question is very simple but I really didn't find any solution here.
I have a Table setSelectable(true), setMultiselect(false), setImmediate(true).
It works fine by first click and moving through the table using arrows.
But if I click again to the row already having been selected,
then it becomes unselected. How to prevent it?
I'd like to have kept just one row always selected.
As from the Vaadin Book here:
If the user clicks on an already selected item, the selection will deselected and the table property will have null value. You can disable this behaviour by setting setNullSelectionAllowed(false) for the table.
So:
table.setNullSelectionAllowed(false);

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.

Delphi DBGrid disable clicking on another row when editing

I have a dbgrid displaying data from a Ttable and my problem is that when
editing a row in the grid the focus is on the row that I want to edit but I can
still click on another row and edit it. How do I disable clicking on another row
or keep focus on the same row?
Second question is (still on the dbgrid) when I edit a column and double click on that column,
the focus moves to the end of the text line therefor not showing the original text but only showing maybe the last character and spaces.
Please help...
After a while of playing around with this, I've discovered that there's no easy way
to disable the user from moving from the highlighted row (row to edit) when clicking another row.
The best way is to cancel when he clicks on another row, I'm using a TTable and TQuery, so
on the BeforePost event, just do a cancel on your table or query. But you also need to do the
same on the AfterScroll even, just in case.
Thanks for all your help.

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!

Resources