With the rows count enabled in the toolbar, there must already be a count of records going on. Is there any way to access a variable for this without having to do a select count(*) from the table again?
One thing you can try is create a simple application with Row count onā¦
Open the Source code and Copy the code.
Turn off the Row Count and then copy that code.
Then go to Diffchecker - Compare text online to find the difference between two text files and paste the two side by side and see what the difference is. It may reveal the Session variable name.
Interesting idea. Will do that.
Report back if you find anything good!
The variable is $this->count_ger , itās available in the onRecord event
not finding that so how do you reference it. The only diff I found (other than session ID) is the following:
ā^span class=āsummary_indicator css_toolbar_objā style=āborder:0px;ā^^span class=āsm_counterā^[1 to ^span class=āsm_counter_finalā^10^/span^ of^span class=āsm_counter_totalā^32^/span^]^/span^^/span^ā
The class and variable must actually be defined elsewhere. Note: had to replace all the >< with ^ so it wouldnāt take it here as a format instruction!!!
Itās a local variable in onRecord event, just use it in your code or assign it to other variable
[variable] = $this->count_ger;
{variable} = $this->count_ger;
If you need it, the first record of the page is $this->nmgp_reg_inicial;
The last record is $this->nmgp_reg_final;
The current line (on screen) being process is $this->SC_seq_page;
the first line of the page is always 1, so to know what is the current record you need to
$CurrentRecord = $this->nmgp_reg_inicial + $this->SC_seq_page - 1;
Will experiment and report back! Thanks.
m
Is this still valid?
Iām looking at an editable grid and trying to establish the current line in the onloadrecord event, but $this->SC_seq_page; is returning nothing. Iām sure Iāve seen this work in the past!
Edit
For my purpose it seems to be $sc_seq_vert which gives the row number.
I am not using that anymore, on MySQL I use the @rownum reserved word to add the row number to my SELECT
SELECT @rownum:=@rownum + 1 as row_num,
t.field1, t.field2, t.field3, ...
FROM (
select field1, field2, field3, ... from myTable
) t,
(SELECT @rownum := 0) r;