Number of records and the initial value of the field

QuestionsNumber of records and the initial value of the field
Davor Budimir asked 12 years ago

Hi,

$opt["rowList"] = array();

$grid ["rownum"] = "25", does not work. Always showing 20 records.

and the second question is how to set the default value of the field (eg. current date on date field) but of course, just as the initial entry?

Regards,
Budimir

3 Answers
Abu Ghufran answered 12 years ago

This seems to be some array name confusion, ideally $opt and $grid both config should be of same array which is passed to ->set_options() function. Please recheck.

For default values, See docs …

Render as textbox with size 20, and initial value in textbox to 10

$col["editoptions"] = array("size"=>20, "value"=>'10');

You can replace this 10 with date("Y-m-d")

Davor Budimir answered 12 years ago

I checked but it still does not work.
When I remove (hide) combobox with paging records I always get 20 records per page?

Also, $col['editoptions'] = array ('size'=> 20,'value'=> date('Y-m-d'));
Works but not properly.
Namely, when I edit an existing record then comes to replacing the existing values ​​with ​​default values (again)?
Default value should be assigned only when adding a new record.

Regards,
Budimir

Abu Ghufran answered 12 years ago

Hello,

Please use defaultValue instead of value.

$col['editoptions'] = array ('size'=> 20,'defaultValue'=> date('Y-m-d'));

For paging fix, please use

$grid["rowNum"] = 15; // or any of your desired rec/page
$grid["rowList"] = array();

$g->set_options($grid);

Sample files emailed to you.

Your Answer

8 + 3 =

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?