I have a expandable listview with textviews as rows and a webview as a child of each row (group). when user cliked on a group (row) webview with html loaded. after scrolling the webview towards end and then clicking another row doesnot show the group at top. it automatically scrolls down.
I want to scroll upwards so till currently selected group is at top.
thanks
You need to implement OnGroupClickListener with return value true to prevent event flow. In the OnGroupClick you can use setSelectionFromTop(groupPosition, 0); to move just expanded group to the top of ExpandableListView. Also you need to call expandGroup() and collapseGroup() in the listener. But you should note what you will override general behavior of ExpandableListView in ItemClick event with expanding and collapsing groups, such as animate and etc.
listView.setSelectedChild(selectedGroupNo, selectedChildNo, true);
does the trick.
Related
As the title say:
I want to know values of a scrollbar in the ListView such as:
Minimum value I know = 0 :)
Maximum value of a scrollbar
Current value (position of a bar inside of a scrollbar)
Is this possible?
How to make it work for both iOS and Android?
I have tried with ItemAppear to get the position in the ListView but all I can get is the position of an item not the actual scrollbar position and with ItemAppear the problem is if I have big images in the list then I scroll 1 mile but nothing happens until the other item appears.
ListView doesn't fire Scrolled events like ScrollView does.
If you still want to get current value or maximum value of scrollbar, I suggest you can render new Listview, that contains scrolled event. or you can search some third party control, may be have this event.
I want to make the search bar disappear by clicking the navigation bar item and make the collection view to fill the blank, animated obviously. ( like making the screen move upwards because the keyboard is showing )
is it Possible also to make it disappear when I scroll down an appear when I scroll up again ?
I dont think both ways will work at the same time but anyway I want to know how to make each way work.
thanks for the help :)
A collection view is a scroll view. A scroll view can have a delegate. A scroll view's delegate is told when the scroll view is scrolling. Therefore you can do anything you like in response to the user scrolling the scroll view, including moving the search bar.
I need expand/collapse feature to show/hide rows in SlickGrid.
So to implement this feature, I have a expand/collapse icon on the Grid header row. And by pressing it, it should Show/Hide all data of the grid (Toggle Visibility).
The feature I want to implement is exactly same as grouping where parent row can be expanded/collapsed by clicking on **+ or -** icon. But without applying grouping.
Should be pretty easy. Just find the viewport div and toggle its visibility on click. Everything else should collapse around it.
I'm essentially making a 'shopping cart' UI and I want it so that when the user hits the 'Add' button, a little tiny box-label appears at the bottom of the screen that says 'Added Item' or something like that.
My question is how to do that with my current set up. I am currently using a nested Grid inside of a Scroll view for the main content of the page. I want the box-label to fade in at the bottom of the screen and stay located at the bottom of the screen ontop of everything else even if you scroll, until the animation fades.
Now i figure it doesn't make sense to add it into the grid since the grid's end will be out of view in the scrolling part of the scroll view, and same for the Scroll View. I am considering nesting the entire scroll view inside of a stack layout but i fear the button will just be located at the end of the stack layout under the scroll view instead of on TOP of the scroll view. How do you recommend I achieve this effect?
I prefer not to use a custom renderer if possible due to my lack of experience in the three separate platforms.
Thanks
Make vertically oriented stack layout. When you need to add you animation add it programmatically to the stack. When it finishes remove it from stack. Your scroll view will not affect animation
I am new to jQuery and i want to figure out how to select multiple elements for my navigation bar i'm trying to create. I want to have it check if the users mouse is over the item in the navigation bar or over the drop down menu (otherwise the drop down menu would disappear). I have tried to use:
$('#nav_item_1').mouseenter(function(){
//make the drop down menu visible and change nav_item background here
}); `
$('#nav_item_1,#dropdown').mouseleave({
//revert everything back to normal
});
but then when i try to move my mouse from the item in the navigation bar to the drop down menu it reverts everything back to normal.
The issue that you're having is because when you leave the navigation bar item .mouseleave is being triggered instantly hiding the #dropdown with it.
What I would do here is set a slight time out on the mouseleave event of the nav_item about half a second or less to hide the dropdown. This will allow the user the amount of seconds set outside of the navigation bar so that they can hover over the dropdown. After the user is on the #dropdown I would clear the timeout preventing the normal behavior of the dropdown hiding.
How would you do this with code?
$('#nav_item_1').mouseleave(function() {
/* set your time out here to return everything to normal. Because we want to allow the dropdown to stay visible for a fraction of time required to move the cursor to the dropdown.*/
});
And then,
$('#dropdown').mouseenter(function() {
// clear the timer to prevent normal behavior (keeping the dropdown visible).
});
Check out this link: http://www.w3schools.com/js/js_timing.asp
Regarding your original question about selecting multiple items. You are doing it corrently. But as I explained above your code is not reaching the mouseleave event of the #dropdown.
The second piece of code makes it so that when you leave #nav_item_1 OR #dropdown, everything will be reverted. So when you leave the #nav_item_1 to go to the #dropdown, the event will fire.
You could check every mouse move if the current mouse target contains the dropdown or nav_item:
$("#nav_item_1").mouseenter(function () {
// make menu visible etc
}
$(document).mousemove(function (e) { // note the e parameter
if ($(e.target).has("#dropdown,#nav_item_1").length !== 0) {
// revert
}
}
This requires the two elements to be very close to each other in order for it to work properly though.