Row numer on export

QuestionsRow numer on export
Samsun asked 11 years ago

HEY,

How must i do if i want to display row number of data when export the grid?

Regards,
Samsun

1 Answers
Abu Ghufran answered 11 years ago

You can create a virtual column e.g. 'row'

$col = array();
$col["title"] = "row"; // caption of column
$col["name"] = "row";
$col["hidden"] = true;
$cols[] = $col;

and for export listing, use this sql syntax.

$g->select_command = "SELECT @row := @row + 1 as row, t.* FROM clients t, (SELECT @row := 0) r";

more help from this link: http://stackoverflow.com/questions/304461/generate-an-integer-sequence-in-mysql

Your Answer

6 + 12 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?