How to know which leaf item were tapped in Nested list? - sencha-touch-2

Who knows is it possible to know which leaf item in NestedList were tapped and use this value in the Store?
May be I can use leafitemtap not only in listeners of NestedList?

According to this:
http://docs.sencha.com/touch/2-0/#!/api/Ext.dataview.NestedList-event-leafitemtap
the leafitemtap listener function gives you the following params:
leafitemtap( Ext.dataview.NestedList this, Ext.List list, Number index, Ext.dom.Element target, Ext.data.Record record, Ext.event.Event e, Object eOpts )
in which:
this points to your current nested list
index is the index of tapped item
target is the DOM element of tapped item
record is the model object of tapped item
Suppose that your model has an id field. Then:
record.get('id') will return the id of tapped item. You can use this to look it up later in your Store.

Related

How to find an item having same id by index from a list view

In XCTest, we could find a specific UI element by index, for instance, a list view has reused item with same identifier.
app.staticTexts.matching(identifier: "BETTER").element(boundBy: 1)
So, do we have an alternative method to find an element from a list view for Android UIautomator. I found this one could get element by id, but seems it only returns the first match.
mDevice.findObject(UiSelector().resourceId("id"))

Get new parentId of row after drag and drop in ej2-treegrid

I have a syncfusion treeGrid component with drag and drop activated. When a component is dropped I would like to know what row is gonna be the parent after the drop (what's the new parentId).
Searching the documentation, you have these events that fire from drag and drop actions. Sounds like you want to listen to rowDrop event. This event will provide these event arguments, of which I think you want dropIndex property. With the index of the row dropped on you should be able to look up the id and other information in your rows data array.
From using getCurrentViewRecords method, we can get the ParentItem or ParentID of the dropped Child with Children property of that record and if it is dropped as Parent, ParentItem remains undefined. You can get the details from actionComplete event of the TreeGrid after rowDrag and drop operation.
Refer to the documentation lInk:
https://ej2.syncfusion.com/vue/documentation/api/treegrid/#getcurrentviewrecords
https://ej2.syncfusion.com/vue/documentation/api/treegrid/#rowdrop

Deselect v-list-item when changing its value

I have a v-list-item-group with some v-list-item's inside with an associated value. The problem is that when I change the value of the selected v-list-item it doesn't react. I want it to be selected only when the new value matches the v-list-item-group's model and be unselected otherwise. What is the best way to achieve such a behaviour?
Example. When you edit the list item value, for example, by changing the lower left field from "Bluetooth" to "Bluetooth1", I want the list item to get deselected automatically because its value isn't longer matching v-list-item-group's model ("Bluetooth1" != "Bluetooth"). And when you change it back to "Bluetooth" I want it to get selected again.
The one on the right modifies the v-list-item-group's model and this works as expected.
My actual use case is rendering lists of thousands of elements quickly without rendering them all. To achieve it I use a recycle-scroller component inside my v-list-item-group to manage its items. It creates a few dozens of v-list-items and as user scrolls it reuses them by moving them around and replacing their value, icon and text with corresponding data from my array. The problem is that when user selects some list item then scrolls the list, the selected item gets reused. Despite the fact that it now has a different value, text and icon it still looks as selected. So they see it as if some different item was selected.
I hope this works for you:
<v-list-item-group v-model="model" :color="color">
// other html
Then add a computed property:
computed: {
color(){
if (this.model == this.items[1].text) {
return 'indigo'
} else {
return 'black'
}
}
}

how to get child properties of the div object for rational functinal tester

in my application i have a dropdown which is div object.the dropdown contain names and checkboxes.i need select the checkbox based on name. checkbox dont have any name.just index.can any one suggest how to get chaild items or properties of the objects for div object.
and the second question is i have tree view .which is teleric object.RFT is unable to find the object.it identifying as one all tree view is one object.its not identifying the childs,sub tree items....
so please help me on this two issues.
Hi you can get the checkboxes as follows:
void getCheckBoxes(TestObject parentDiv)
{
TestObject[] checkboxes = parentDiv.find(atDescendant(".class","Html.INPUT.checkbox"));
System.out.println("Found " + checkboxes.length);
//Go through them , and decide which one to select.
for(TestObject checkbox: checkboxes)
{
System.out.println("Checkbox Value: "+ checkbox.getProperty(".value"));
}
}
you can call the above method and pass it the parent DIV object.
About the second question:
You have not mentioed how does RFT recognize the one object for the tree ( means which proxy does it use as per the object map's adminitrative properties for that object).
Usually controls like tree /grid etc are recognized as one control and the items of these controls as "Subitem" which are found by specifying subitem as atPath("xyz->abc") etc.

Sencha Touch 2: Give a different itemTpl to nested list leaf nodes

In my nested list I have 2 levels. Currently it shows a standard list. When you click an item it takes you to a list of that item's children. Those children are the leaf nodes. So when you tap one of those it takes you to the detail card for that item. I'd like to use a different list item template for the children than the parent items. Is there a way to use Ext.XTemplate to check if an item is a leaf node or not?
Figured it out:
Simply update the x-list-item-leaf class
.x-list-item-leaf{
color:red !important;
}