Can I use Events on Laravel5.5?

QuestionsCan I use Events on Laravel5.5?
hirohito wada asked 2 years ago

I can't use Events on Laravel5.5.

source
$e["on_insert"] = array("add_kamoku", null, FALSE);
$g->set_events($e);

error messeage.

call_user_func() expects parameter 1 to be a valid callback, function 'add_kamoku' not found or invalid function name
/Users/hirohito/Laravel5/ringi/app/Classes/phpgrid/jqgrid_dist.php#2167

5 Answers
Abu Ghufran answered 2 years ago

It appears that your function add_kamoku is some class method and not global function.
In that case, you need to pass class name as second param. e.g. if your class name is 'Foo' you need to set:

$e["on_insert"] = array("add_kamoku", "Foo", FALSE);

hirohito wada answered 2 years ago

Thank you.

It solved. A little problem remains.

'jqg'+xx(xx is integer) show in Id column(Primary/autoincrement).
When reloading, It change integer.

Abu Ghufran answered 2 years ago

You can set:

$opt["reloadedit"] = true;

$g->set_options($opt);

It will force reloading after add/edit.

hirohito wada answered 2 years ago

Unfortunately it doesn't work.
My options is follow

$opt=$this->opt_edit('科目一覧');
$g->set_options($opt);

——————————————-

protected function opt_edit($param) {

$opt=array();
$opt["cellEdit"] = true;
$opt["scroll"] = true;
$opt["autowidth"] = true;
$opt["resizable"] = true;
$opt["viewrecords"] = true;
$opt["caption"] = $param;
$opt["actionicon"] = TRUE;
$opt["reloadedit"] = true;
// $opt["toolbar"] = TRUE;
// $opt["toppager"] = TRUE;
return $opt;
}

Abu Ghufran answered 2 years ago

Can you check if this issue exist on demo: http://phpgrid.org/demo/demos/editing/inline-add.php
If it's working in demo, please compare you code with it.

Your Answer

7 + 7 =

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 / 5. Vote count:

As you found this post useful...

Follow us on social media!

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

Let us improve this post!