I have a table that I do not want groups on but I do want to sort the rows by all columns. If I turn off Groupable then sorting quits working. Is there a way to fix this?
What properties control sorting and grouping and how do they work together/against each other?
You can turn off groups using ShowGroups (on the listview not the column)
olv.ShowGroups = false;
Related
Can someone advise whether #SetViewInfo can be used with click to sort columnns.
When a view is filtered using #SetViewInfo it removes the column sorting options, thus removing the functionality of the view. Even when resetting to all records the column sorting option is not available, however I have overcome this by opening a second view then opening the original view, messy but it works. I am using View Action Buttons. (Not sure how to store the value in a Check Box Action).
Filtering
#SetViewInfo([SetViewFilter]; "userinitials"; "$80"; 1)
Resetting.
#SetViewInfo([SetViewFilter];"";"$80";1);
#SetTargetFrame("frame");
#Command([OpenView]; "DummyView"); //Needed to get the click to sort back
#Command([OpenView]; "OriginalView")
Also if the view is already sorted on another column, ie not in a categorised state no records are found. I don't want to have to remove the sorting options on my views. The help implies you don't need to have the view categorised. But I cannot get it to work if I don't, ie if I use 0 on an uncategorised view nothing happens.
From Help
isCategory - Number. Boolean value. Required in a Standard Outline view; not for use in Calendar views. 1 indicates that the column in the columnName value is a category. 0 indicates that it is not.
Is the #SetViewInfo limited as I have found or am I missing something?
Any help appreciated.
Yes, #SetViewInfo has limitations. As far as I know, you cannot keep the sorting when you use SetViewFilter. I also believe you need to have the view categorized, at least in older versions of Notes this was the case, if I remember correctly.
Limitations like this is why I personally don't use #SetViewInfo very often (if at all), I try to use other ways to display filtered documents.
One way I have handled it in the past is to use a special form with a rich text field, and then I build a list of filtered documents (e.g. through a search) and render the list of documents in the rich text item.
I use this technique to do that: http://blog.texasswede.com/dynamic-tables-in-classic-notes/
Is there a way to hide an entire row, not just a single column, in a grid? I'm tried PXUIField.SetVisible, PXUIField.SetVisibility, PXUISetVisible, and PXUISetVisibility, but none of them seem to work. I know that using PXUIField.SetEnabled(cache, row, false) disabled the entire row, but can I make an entire row invisible?
You need to make sure the row is not returned in the query (could override the view delegate and not return specific rows) or removed from the cache. I don't think there is anything that can hide a row using the UI related calls, but I have never come across the need for this to ever try it.
The usual pattern is to use a PXFilter DataView current DAC record to filter the PXSelect DataView bound to the grid.
The filter fields are often changed on screen directly by the user but you can also set the value of the current filter DAC record programmatically in event handlers to build more complex logic.
public PXFilter<DACFilter> Filter;
public PXSelect<DAC,
Where<DACFilter.field, Equal<Current<DACFilter.fieldFilter>>>> GridDataView;
I'm having this categorized view displayed in a view panel where the category column itself is not shown. Instead I'm displaying a combobox above the viewPanel where users can select from all the categories available (see screenshot below). The combo is bound to a scopeVariable and is refreshing the viewPanel onChange. The viewPanel has a computed categoryFilter reading from the same scopeVar. That all works nicely.
Now I also have implemented an additional wildcard (*) value in the selection list which (if selected) programmatically sets the cat filter to NULL. This way I'm forcing the viewPanel to show all entries. Again, this works fine, but with the drawback that now the view is showing empty rows where the category entries would be shown normally (in the screenshot you see empty rows above each entry, with 2 entries for the category "edcom GmbH" obviously belonging to the same category; those aren't separated by an empty row):
One way to at least hide those empty rows would be through means of css coding. But I would prefer those rows not being rendered at all.
Can this be done at all using a viewPanel, and how? Or do I have to use other controls like a repeat or a dataTable maybe?
Thanks in advance,
Lothar
One "hack" (an ugly one I admit) would be to change your categorization column from Firma to Firma:"--All--" or Firma:"*" and then instead of setting the category filter to NULL you set it to "--All--" (or "*").
The double category hits the indexer, but should do what you need.
Obviously there's no easy way. So meanwhile I'll stick to this css-style solution:
In the view panel und All Properties - data I set var = "entry". Then, under All Properties - styling I set a programatic value for the rowClasses property:
if(entry.isCategory()){
return "rowStyleHidden";
}
return "";
The style class "rowStyleHidden" hides those rows using
display: none;
Don't know yet how this turns out performance-wise, I'll have to observe this once I implement it in a copy of the real database.
You can also switch to a none categorized view, by having the viewname calculated based on the value in combobox.
I want two rows and first row has two columns. But I do not found any property by which I can set size of column. I place toolbar in first row and first column. I want to hide it progemmatically. So, how to design UI by using TableLayout?
Use the ColumnStyles property:
tableLayoutPanel1.ColumnStyles[0].Width = 0;
Not so sure that makes sense, every control in the colum will get hidden and the other columns will grow proportionally. Hiding a control is otherwise simple, just set its Visible property to false.
I have a QTreeWidget which uses the QAbstractItemView.ExtendedSelection property, allowing users to shift click and control click items.
I'd like to preform actions on these items based on the order in which they are selected-- I can think of ways to design my own systems to determine the selection order, but is there a native function/property that will return a list of items sorted via selection order?
Thank you for your advice!
The underlying selection model naturally preserves in the order in which items are selected. So you don't really need to do anything special - just iterate over them like this:
for item in treewidget.selectedItems():
print item.text(0)