NSTable scroll automatically when i select a row from code in osx - cocoa

I have a table with a lot of rows (means that i should scroll to see last rows),i select row from code with below code and i want to write code that table scroll automatically and show selected row to me .
int currentIndex=..;
NSIndexSet *index=[NSIndexSet indexSetWithIndex:currentIndex];
[self.tbl selectRowIndexes:index byExtendingSelection:YES];
i use displayRect like below for table but doesn't work
[self.tbl displayRect:NSMakeRect(0, currentIndex*30, self.tbl.frame.size.width, self.tbl.frame.size.height)];

Try scrollRowToVisible: row
Cheers

You should use the NSTableView method, scrollRowToVisible:

Related

How to duplicate a current record focused in oracle forms?

I'm practicing oracle Forms, and I would like to know how I can to duplicate all values from a focused record. Do you have any idea? Thanks.
For example, I have actually my cursor focused in the record marked in yellow, I would like to click in "Duplicar" button (Duplicate in English) And then duplicate the actual record. How can i do that?
Click on the option insert new record, this will create an empty row just beneath the record you selected.
Then click on the duplicate record button, this will duplicate all the values from the row above in the row you just created.
If you want to be this automatic you can write a Key-duprec trigger in which you put the following code:
insert_record;
duplicate_record;
as much as i understand, you can perform these steps:
Firstly, you don't need to click on the duplicar button, use
WHEN-NEW-RECORD_INSTANCE trigger of comprobantes(master block).
In this trigger write this code:
declare
v_detail_blk varchar2(99) :='detalles';
begin
set_block_property(v_detail_blk,default_where,'cmp_no = '||:comprobantes.cmp_no);
go_block(v_detail_blk);
clear_block(no_validate);
execute_query;
end;
On the Duplicate button's when-button-pressed trigger you can call the built-ins create_record and then duplicate_record. This will insert a copy of the record that current;y has focus.

jqGrid Drag-and-Drop Receiving row highlight

Using jqGrid - would like to drag from Table A into an arbitrary row in Table B. Would like the rows of Table B to highlight as I hover over them during a drag. Is this possible?
Even better, can I insert into arbitrary fields in the destination row upon drop?
What I am doing is populating a row field-by-field.
Thanks.

Selection is not getting highlighted in my NSTableView table

I have a view-based table in my app. Everything works good except that when I click on the table entry the row/column I get the click and the content of my pick is sent to corresponding method, but the row is not getting highlighted.
I'm curious why is that, and can the problem be that I have a view-based table, not cell-based?!
Try this:-
- (void)selectRowIndexes:(NSIndexSet
*)indexes byExtendingSelection:(BOOL)extend
check whether u have set the empty selection or not. if u didn't set it in code check in nib properties or try by setting this setAllowsEmptySelection:no By default setAllowsEmptySelection is YES
I found the answer to this question here thanks to Peter Hosey
How to select items in NSOutlineView without NSTreeController?

Insert cell in table row eclipse birt

I can't seem to find a way to insert another cell in a row of my table in a Birt report in Eclipse, does anybody know how to do that?
Thank you
Not exactly sure which problem you are having but the solution should either be;
1 Insert a column in the table
Select the table
Right mouse click at top of column and insert a column to left or right
2.Insert a grid into an existing cell, without adding a column. (Usually you do this when you want to have a label and an aggregation in the same header or footer cell)
From the Palette, drag and drop a 'Grid" element into the cell,
set 'number of columns' to 2 and 'number of rows' to 1.
put you other elements (i.e. label and aggregation) into the seperate cells of the grid in the single cell of the table.

BIRT: Alternating row Color in a table group

Has anybody an idea of how the highlighting condition has to look like, to create alternating rows in groups? I want the every row with an even number of a table group (not of the whole table) to have a different color.
Thanks in advance! :-)
Patrick
P.S.: I'm using BIRT 2.1.3
Add a highlight to the row like this:
row[0] % 2 Equals 0
This works because row is the current row and row[0] is the rownumber. row[1], row[2] etc. are the data values for the current row.
(Source: http://dev.eclipse.org/newslists/news.eclipse.birt/msg03977.html)
For Birt 2.3 reporting
Click on the table from the outline view. The on the properties editor, clikc the Highlight tab. Click Add. You will see three drop downs. Just type row.__rownum % 2 in the first drop down. Select the Equal to from the second and then type 0 in the third. Then you set the background color of the row to whatever color you want most times I use silver.
Hit ok and thats all.
Total.runningCount()%2 Equals 0

Resources