Want to add a column for serial Number

QuestionsWant to add a column for serial Number
Ankur Garg asked 10 years ago

In grid I want to add a column for Serial Number that having incremented value.
How to do that . Please help.

3 Answers
Abu Ghufran answered 10 years ago

You can set incremented serial no, using on_insert event.
In on_insert callback function, you can run a select query to fetch max serial number and set it incremented for insert.

Refer demos/editing/custom-events.php

Ankur Garg answered 10 years ago

I am new to PHPGrid. The refer link is blank and having no code. I don't want to insert any thing in the database. Just want to show the serial number of each row.

I have show the serial number against each row by setting

$grid["rownumber"]="true";

but this is not the solution of my problem of adding new column of having incremented value.
Please send the code of same.
Thanks

Abu Ghufran answered 10 years ago

The custom events are supported in full version.
If you are planning to achieve it in free, you can refer this link and generate artificial sno. with sql.

http://stackoverflow.com/questions/11094466/generate-serial-number-in-mysql-query

Your Answer

20 + 0 =

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?