Pivot Control inside Listbox control - windows-phone-7

I would like know if it's possibel to put a Pivot Control inside a Listbox. This way one of the items inside the Listbox would be a Pivot Control. Idea here is that when showing a list of photos a collection of photos could be shown as a Pivot Control inside list. I know that this might not be the best possible UX, but I'm more interested to know if it's possible at all?
At the moment I have a code that should work, but for some reason the pivot control is just empty.

Related

Primefaces selectManyMenu: Showing selected items on top of list

I'm using Primefaces' selectManyMenu to display a list of hundreds of items. I've also included a filter on top. The issue is that when I select, say, the 200th item in the list, I have to manually scroll down to the 200th item each time to see if it has been checked.
I want it so that whenever I select an item, it moves to the top of the menu, so that it is easy to view all the selected items from that list at the top without having to scroll down and up all the time.
Any suggestions?
Looks like your component is getting updated when selecting or unselecting an item, and that's the reason you're reloading the list and losing your scroll position.
Else, it looks like you could use a workround for this. Something like
Catch the select/unselect/change event and trigger a backing Bean function where
You rearrange you list of items sot that the selected ones will be pushed first
oncomplete, you will update your selectManyMenu component.
By the way, maybe it's time to think again if you're using the right component and UX practice. and I have the impression that selectManyMenu is not meant to be used with lists of 200+ items. Personally I think you should avoid using a list that will have to scroll down, for selectMany components. For example you could use another component like a pickList

extjs 4 How to change ordering of shown column dropdown on grid

Using extjs 4.1.1
I have a grid with lots of columns >20.
Initially, most of these columns are hidden.
If a user wants to unhide the column, they select the menu on any column, then select the "columns" choice, this expands another dropdown/dropout which shows all of the columns. Those with checkboxes next to them are shown.
My issue is this:
The columns in the dropdown are shown in the order in which they are defined/displayed in the grid. The order in which they are displayed in the grid has been chosen for a good reason( e.g. id as the first column). However, when a user wants to display one of the hidden columns, it is hard for them to find it in the list. This is because the list is sorted in the order the columns are defined. I want to sort the column dropdown/dropout list in alphabetical order, without effecting the order of the columns in the grid.
How can this done?
I think I found the solution to your question.
First of all I don't have the Ext JS 4.1.1. framework on my current PC. So I tried to figure out you problem reading the Ext JS 4.1.3. documentation available on Sencha's site. But I don't think that they have made drastical changes in this part of the framework between the two minor releases so my solution should work in your case too.
I have tried out my solution using JSFiddle. Unfortunately they did not have the 4.1.1. ext-all.css file, so I have linked manually the 4.0.2 file available at Sencha, so the menu is looking a bit missplaced.
The header menu and it's submenus are managed by the Ext.grid.header.Container class. The column submenu is constructed by the getColumnMenu method. The whole menu is purged and reconstructed on every drag and drop or other event which should affect the grid view. As a result it is enough to overwrite this method in order to solve the problem. Because the headercontainer class is too deep in the framework it is hard to extend it, so you have to make use of the Ext.base.override method.
The column submenu's menu items are created from the result of the
items = headerContainer.query('>gridcolumn[hideable]')
query. So you have to first sort alphabetically the result, before creating the menu items. I have added to the class the sortColumns method which does all the sorting stuff.
So here is what I did: link to my solution.
I hope that this is what you were looking for.

Dynamics AX 2009: How to sort an unbound form control's contents?

I was using a Listbox control on a form, and programmatically adding items to it. I thought that if I called the sort(SortOrder::Ascending) method on the Listbox it would do just that -- however, I was wrong.
Ultimately, I am unable to achieve these results. I don't have to use a Listbox, but I need two pieces of functionality:
Programmatically be able to add Strings to the control
Be able to run code when an item is clicked or selected
The list should be able to be sorted alphabetically
I couldn't get the listbox to sort either. Easiest might be to use a "ListView" control instead of a listbox. You can see how to use AND sort in (AOT>Forms\tutorial_Form_ListControl). Your requirements #1 & #2 are possible on almost anything you do. The issue is sorting I'd think.
Another option, keep a local variable that controls the sorting. I would use a collection class, either an Array or Map so you can control the sorting via key-value, then you could just re-load the listbox when the user added/removed something. Since it's client side and it doesn't sound like the listbox will have 1000+ controls, re-loading it probably won't be a significant performance hit. You can also use listbox.insert([value], [index]), to insert into the correct location if you are controlling properly.
Another option, hi-jack any simple table from the AOT (TmpABC is a good one), insert the values, then sort using a simple query or even better, set the TmpABC to the ListView control's datasource and just sort via datasource sort..

Backbone.js Use View to Manipulate Another View

My question is mostly conceptual about Backbone.js, but I can mock up some code if my question is unclear.
Consider a case where I have 2 sections on a website. A list of items as one view and another view that has a dropdown to select how the list of items should be sorted. Obviously, the list of items is associated with a collection of models that stores the actual data that populates the list. But I'm unsure the best approach for triggering the collection to be sorted differently when the other view's dropdown changes. Should I be changing the actual order of the collection, or just render the view in the order that I want in the view?
Also, is it a good idea to use a model for the dropdown to keep track of the state of the dropdown, and bind the list of items view to that model so that I know when to rerender the list of items?
You could take several roads here. Here's a few:
Use a router. The router would hold your views, or at least the top-level view (cleaner), and your dropdown view would trigger a route change, which would pass the information along to the view. Best if you want clean URLs.
Make a pointer to the list view in the dropdown view. When the dropdown view receives the change event, it explicitly tells the list view to update. (IMO a terrible approach, but listed here for completeness.)
Back everything with models. (Like you suggest in your last question.) The dropdown view would be backed by a model, and the list view could bind to that model's events. (Again, the list view still has to know about the dropdown model—not ideal.)
Make an event manager. When your dropdown recevies a change, you trigger 'sort' and anything that cares can listen to that event. This isn't a trivial solution but isn't overly complex either. Your list view could then register its intent to listen to the sort event with the event manager, thereby abstracting the actual view inside the event manager and away from the dropdown view.
1 & 4 are effectively the same thing, just depending on whether you want a router or not.
Basically my heuristic with these sorts of scenarios is "nothing should know about things it doesn't need to know about." Applied here, that means that your views shouldn't know about each other.

howto hide/show pivot element in WP7?

is it possible to hide and show a pivot element?
e.g. i want a option in my app in which i can show or hide one special pivot item which is not usefull for every user.
It appears that it's not possible to hide an entry in the items collection.
The only option available is to remove and add the item from the pivots Items collection.
Depending on the application and the design of the pivot it may be appropriate to leave the item always there but give it the header "advanced".
You can remove the pivot item from the parent pivot control
parentPivotControl.Items.Remove(pivotItemToBeRemoved);

Resources