Titanium Mobile editable row moves inner row elements - ios

I have a tableView with multiple TableViewRow objects, always 4.
When the edit button is clicked the row can be reordered, which is working.
But when the edit button is clicked the elements inside of a row seem to be moved with margins from left and right.
The items in a row should not be moved, so I was hoping someone could tell me how I can make sure the labels inside a row element are not being moved around when edited.
I have included some images, hoping to clarify my question:
Rows when not edited
Rows when edited

The solution was easy, but I didnt know.
The way to achieve this; Add a view to each row and do NOT set the left or right properties.
This way the delete button and move icon are not pushing the inner view away.

Its a default behavior. I dont think there's any way defined in Titanium API to override the moving of inner elements. So you cannot change this default behavior.

Related

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);

cxGrid expand row height to new line with enter

This is a little hard to explain so please bear with me. When I am editing a text field in one of the columns I would like to,when I hit enter, go to new line under the edited text so the grid basically expands.
Options-View-CellAutoHeight set to true expands the cell but editing is terrible.Cant
see a thing where the first line is,where it ends,etc...
Here is the grid:
I can not go after the last letter 'a' with my mouse cursor and hit enter so another line gets added. Which settings regulate this ? I know it can be done since I had a grid once and could do this.
EDIT: This requires no code just applied settings.
Just tested it with DevExpress VCL 13.2 and it can be easily done without coding (if I understood what you want to achieve).
Basically, you need to set following properties:
Assign a Memo to the Properties of your column and make sure its WantReturns property is set to true.
In your TableView set the OptionsView.CellAutoHeight property to true.
Also in your TableView, set the OptionsBehavior.EditAutoHeight to either eahEditor (editor is sized vertically to fit the content) or eahRow (the entire row is sized when editing) as needed.

How to create a Hierarchical menu in iOS?

In my application, I have a menu that is defined as follows. Each item on the menu is a node that has the following data attributes:
MenuText : (the text that would appear for that item)
isView : Whether this item is a leaf level item or not
subMenus : if isView is false, then there are multiple menu items under this attribute.
Thus, it is a tree structure that can go till any depth. The items in the menu can change periodically and hence the implementation has to be kept flexible. This data is stored in a plist file and read into an NSArray in the code (already implemented).
I now need to create a slide out menu on the left that will be populated by this data hierarchy. I have created the menu pane and added swipe gestures to it, all of which work fine. The menu has to be a collapsible one where clicking on one menu item expands the subViews below it. If the item clicked on is a view, then a new view is loaded on the rest of the screen with appropriate data.
The problem I am facing is the logic to populate the menu (which is a UITableView) from the NSArray data. The following are the two approaches I came up with.
Create a UITableView with as many sections as there are items at the top level of the menu. Then iterate through the menu items recursively. For each menu item that is not a view (i.e. it has subMenus), create a new section with number of rows equal to the number of subMenus under it. When I come across a menu item that is a view and has no further subMenus, add it as a row to the subsection created for the menu one level above it.
Create a menu with one section and as many rows as the number of menu items at the top level. When a menu item is clicked, insert rows under it to represent its sub-menus. When another menu item on the same level is clicked, collapse the previously expanded menu by deleting the inserted rows. When a menu item with no sub menus is clicked, the rest of the screen is populated with data.
I have tried both the approaches and not been able to go beyond the initial steps. For the first method, I understand that I need to add a UITableView as a part of UITableViewCells, which is good, but I need to do that recursively. For the second approach, I need to know the indexPath of each item clicked which can go to many levels.
I would like some suggestions here about which approach I should take and some guidance over how to go about it. Also, if there is any better way to do this, kindly advice. Thanks.
In my opinion, using UINavigationController is the easiest way. You can push as many UITableViews as you want.
If it doesn't fit your design requirement, you can try expandable UITableViews. There are few open sources:
JKExpandTableView
SDNestedTable
iOS-Tree-Component
Thanks for the responses. I ended up doing this using the following control:
Accordion for iOS
It has served my purpose beautifully and I posted it here so that someone with the same requirement may find it.
Take a look at TLIndexPathTools. It has a "Tree" extension that can do this. Try running the Outline sample project. The main task in adapting the sample project would be to write a recursive function to convert your array of nodes into an array of TLIndexPathTreeItem objects. All of the code in the controller:willChangeNode: method is examples of lazy loading and it doesn't sound like you'd need any of that.

show elements on touch event of iPad

I need a function to show some action items in each row of a grid when user tap/ touch the row. As shown in image attached. At one time only one rows action items should be visible.
Any help would be appreciated.
Regards,
Era
You are using UITableView only right. Then you can simply get the index of that row and can change the cell for that index.

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