$grid sort by todays date

Questions$grid sort by todays date
Devon asked 9 years ago

Hello,

Was hoping to load the grid by todays date being at the top?

Thanks

1 Answers
Abu Ghufran answered 9 years ago

Hi,

Do you need something like in this post:
http://stackoverflow.com/a/11396406/385377

Changes required in grid code …

$opt["sortname"] = 'ABS(diff)';
$g->set_options($opt);

// you can provide custom SQL query to display data
$g->select_command = " SELECT *, DATEDIFF(`invdate`, CURDATE()) AS diff FROM `invheader`";

Your Answer

20 + 4 =

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?