Control + 6 is used to show this list of class and method names in the current file
Is there a way I can make the full list always visible somewhere?
The Document Items list should always be at the top of each document. I don't think it ever goes away.
Related
For example when implementing these collapsible items:
First approach that comes to my mind is to store a variable in the model expandedItems: List ItemId
to verify if an item is expanded you check if its id is in the list
to expand an item you add its id to the list
to collapse an item you remove its id from the list
There also are css-only solutions like this one https://jsfiddle.net/5hcwzf7s/2/
What would the advantages / disadvantages of css-only over the id list be?
I think storing the list in the model is common, easy to understand, and the usual way to do things like these.
I find a few downsides to the css solution:
is hard to read and understand
is fragile and hard to maintain
might not work on all browsers
uses href which makes the item id show up in the url when you click to expand
treats expanding as a url change, and when the user clicks back it unexpands the item instead of navigating to the previous page
only allows one item to be expanded at a time
On the other hand, I find no downsides to the expandedItems list approach. Performance might be a concern because we're operating on a list, but the user will have to be expanding thousands of items to make the list long enough to notice any difference. I don't think is polluting the model either, this kind of information is what the model should hold.
I think you want to put this all in your model. The css approach is perhaps a nice trick, but is not very scalable.
In particular you would end up putting state in the css file, and part of it even twice. Keep it all in your model, put the full content into the screen, and then just attach a class when contracted, which sets a max height and truncates the rest with elipsis
I use a TOpenDialog component in Delphi XE7, because I want to select one or more files. However, after I select them and click OK, the selected files are stored already sorted alphabetically, from A to Z, in the Files property, thing which I do not want. I didn't see any switches or options neither in the TOpenDialog control, nor in the TStrings type.
How can I make this component store the selected files exactly in the order that I want to?
The underlying dialog box from the operating system doesn't keep track of that information (or if it does, it doesn't expose it in any way), and the wrapper class provided by Delphi doesn't synthesize it for you.
You can handle the OnSelectionChange event to deduce the selection order. Begin by creating your own ordered list to hold the selected files. When the event is triggered, inspect the dialog's Files property. Remove any entries from your internal list that aren't present in Files. For any items in Files that you don't already have, add them to the head of your list.
The system dialogs do not keep track of the order in which the items are selected. You have no way to get the system dialog to tell you that information. If you really need that then I see two options:
Write your own dialog that does keep track of order of selection.
Let the user specify order outside the file selection dialog.
I am adding menu item to Application bar using this code
ApplicationBar.MenuItems.Insert(0, refreshMenu);
I have 2 other items added from XAML.
But added menu item is adding to the end of list and becoming last menu item insted of being first one.
Is there any way to add menu item to needed index without removing all items and adding in needed order?
EDIT: When I removing menu item from first index, it is removing refresh menu, so the problem is on rendering of menu items.
Thanks
It looks like it could be a bug in the framework (it's not really a common scenario). I'd recommend one of the following (in order of recommendation):
Keep the item there all the time but disable it when it's not needed (as per Shawn's comment). Built in applications do this already.
Swap the entire ApplicationBar to another instance that contains the item (this is a supported scenario)
Remove all the items and re-add them in the order you want
I didn't found any other solution other than I used (remove all items and add then from code each time). So I think the only acceptable way is one I used.
Semi-newbie to jQuery; just can't quite get this...
I have a list of items on a page, and I want to insert a new item at the top of the list by (a) sliding the existing items down and (b) fading the new item into its position at the top of the list. I can get the new item inserted into the list, but so far all the effects I've gotten to work are things like $('#theList').prepend(theNewItem).hide().fadeIn(1000);, which fades in the entire set of items, including the new one, and doesn't do anything about the sliding.
Of course (?), part of my problem is that I need to be applying the .fadeIn (and, presumably, the .slideUp) methods to the new item, not the whole list, but I can't seem to get my hands on it. I can get the ID of the new item, but it's not showing up in the DOM after the prepend (at least, console.log('#theNewItemsID') is returning an empty list).
Any advice out there? Thanks much!
How about
$('#theList').prepend(theNewItem).children(':first').hide().fadeIn(1000);
Demo: http://jsfiddle.net/gaby/CrjQF/
Alternative
If the variable theNewItem holds a jQuery object then you can also use the .prependTo()docs method to skip the filtering
theNewItem.prependTo('#theList').hide().fadeIn(1000);
demo: http://jsfiddle.net/gaby/CrjQF/1/
Explanation
It happend because your initial selector is the #theList so the chained commands refer to that. Using the .children()docs method combined with :firstdocs selector we reduce the selected items to the first child of #theList (the newly added)
I have a View (block display) listing node titles of a certain content type displaying the latest 12 published items. It displays underneath all nodes of a specific type.
What I'd like to do is be able to load the next 12 items with AJAX (I know the pager does this but I was hoping to avoid it) and also control the offset based on the node title.
I think the second request can be achieved with the row number in the query but so far I'm having trouble achieving a working script.
you always can call view results from Drupal API:
$results = views_get_view_result('my_view',$display, $args)
and in arguments you can pass start/end number of items, or something else, depends how you sorting your results
Well, instead of that work, how about selecting the mini pager? I'm pretty sure it only shows previous and next links. If it's not the exact display you want to use, you can override theme_views_mini_pager (from views/theme/theme.inc, line 636) to only show what you need.