How do I select all selected checkboxes in the NSOutlineView - objective-c

I have NSOutlineView with checkboxes:
When I select multiple rows they become blue, however if I check any checkbox, I only select the related item (and its children).
Instead, I would like to check all selected items in the table.
Thanks

Here's a solution:
Create an action in your view controller to handle the new behavior.
Connect your NSButtonCell's action selector to this action.
In the new action, you need to propagate the cell's value to the rest of the selected rows. Call -numberOfSelectedRows on your outline view to find out if there are any more rows you need to act on, and -selectedRowIndexes to get access to the row indexes.
After you make the changes to the fields in the model, depending on how your outline view gets its data, you may need to call -reloadData to update the display of the other rows.

Related

Add button to tree view group row in Odoo

Is it possible to add a button only on the grouping rows within a tree view? For example, I've created a model called x_stock_picking_group. Every stock.picking is assigned to one x_stock_picking_group.
Now within the tree view for pickings, I can group by "Stock Picking Group", and the tree view will divide itself into expandable rows broken down by group like this:
Apologies for the black rectangles, I'm just blocking out customer information. My question is referring to the bold black rows with the dropdown arrows, for example, the rows that say "00005", "00304", and "00005 + 00015".
Is there a way for me to access those rows within the view? I would like to add a button to each of them that will call an action for the x_stock_picking_group. Is this possible?

How to stay in view when searching by filter

I've added Owner to the columns shown in the standard Active Accounts view, as well as some other fields. This turned out as supposed to. However, I've noticed that when I enter something in the search box on the right, the filtering gets me a correct list of accounts but the columns are not the ones that I've set in the view Active Accounts.
Where do I set it to be like that? Preferably so that CRM retains the subset of columns and only filter down the number of records presented. If it's not possible, how do I set the columns presented in the Search Results view (independently of from which view the search's been performed)?
In solution, on where entity views are listed, there is 'quick find' type view. Columns defined in tha view are displayed when search is executed.
You can also define additional search criteria for search, when you modify filter in that view.

Create DataTable child row without showing it?

I am using datatable (v1.10.2 with jquery 1.9.2) because I like the out-of-the-box features (searching/sorting etc). However, now I want the ability to:
1) use animations (sliding) when showing/hiding a row
2) have the hidden row available in the DOM to change (ie, it would exist but have a display:none).
My current code to create the table looks like the following (where formatChild() returns html for a table):
if (row.child.isShown()){
row.child.hide();
tr.removeClass('shown');
} else {
row = row.child(formatChild());
row.show();
tr.addClass('shown');
}
I am using several services to change data in the child row's table via ajax and want to be able to change that data even when the row is hidden. I know I can create a map in memory and use the information in the stored map when I show the child row, but to me it is much cleaner to change the hidden row immediately.
I was hoping I could do a row()child(), modify the row, then call row()child().show() but the row isn't created in the DOM after the row.child().
Regarding the animation, I found an answer here but it involves changing the datatables code :(
I considered just using jquery to add a row to the datatable and hide it, but I couldn't find a good way to "attach" it to the primary row for sorting.
The plan I am currently leaning towards is to add a div to my primary table row that I will show/hide/update rather than using child rows at all.
What is the best practice for managing these hidden areas in a datatable (and showing them with animation)? ty
In case anyone else has the same question, I ended up using a DIV in the row rather than using DataTables' child row. When I add a new row to the datatable, the div is hidden then I hide and show (slideup/slidedown) on a click event. This gives me the nice animations, keeps the sorting simple, and let's me change information in the hidden row. Interestingly, the DIV contains a table and the text that is in that table when I create the new row is searchable; however, the text in the table that my ajax call adds/modifies is not searchable. I'm looking into how I want that to work (and may keep the div out of the search altogether if possible).

Drop Down in every rows of a Rally Table

May I know if it's possible to have a drop down box in every row in the Rally Table?
It is. Check out this example here (scroll down to Displaying Components in Cells):
http://developer.rallydev.com/help/tables
If you'd like to also make an update to the data when the value of the dropdown changes you'll want to wire up a listener to the onChange event and then use RallyDataSource's update method to change the data in Rally.

How would you make a text cell in a an Outline View show how many children the parent row has?

How would you make Rows that are the Top Parent in an Outline View (which is connected to a NSTreeController) display how many children it has in a Text Cell?
If this is a bit confusing here is a Picture of what I mean.
(source: sourceforge.net)
I am talking about the number to the right of one of the rows in the circle, which is displaying how many children the parent has.
You can either make a custom NSCell subclass that will show the child count (you would use your model object itself as the cell's object value, instead of providing a separate string or image), or in your data source method for the outline view you could just include the count along with the title string. Of course, you'll have to use the first option if you want it drawn exactly like the screenshot.
Custom cell, either on that column or on a second column.