how can i send extra parameters using on_data_display

Questionshow can i send extra parameters using on_data_display
aytac asked 2 years ago
 $kurlistesi = ORM::for_table('sys_kurtanim')->where('aktif',1)->where_not_equal('kurkodu','TRY')->find_many();
            foreach ($kurlistesi as $kur){
                $kurkodu = $kur['kurkodu'];
                $col = array();
                $col["title"] = "Bakiye ".$kur['kurkodu'];
                $col["name"] = "balance".$kur['kurkodu'];
                $col["align"] = "right";
                $col["search"] = false;
                $col["hidden"] = true;
                $col["show"] = array("list"=>true);
                $col["sortable"] = true;
                $col["sorttype"] = "number";
                $col["on_data_display"] = array("bakiye_goster_dovizli",$kurkodu, "");
                $cols[] = $col;

            }
            function bakiye_goster_dovizli($data,$kurkodu)
            {
                $id = $data['id'];
                $caribakiye = ORM::for_table('')->raw_query("CALL caribakiyedovizli($id,'1970-01-01','2099-01-01','$kurkodu')")->find_one();
                $cb = number_format(($caribakiye['balance']), 2, ',', '.');
                $cbyaz = number_format(abs($caribakiye['balance']), 2, ',', '.');
//                return $cbyaz;
                if ($cb > 0.01) return $cbyaz . ' ' . $_c['currency_code'] . ' (B)';
                else if ($cb == 0) return $cbyaz . ' ' . $_c['currency_code'];
                else return $cbyaz . ' ' . $_c['currency_code'] . ' (A)';
            }

i want to send $kurkodu but it's not work
1 Answers
Abu Ghufran Staff answered 2 years ago

Hi,

You need to set this variable as global and then use it inside function. e.g.

function bakiye_goster_dovizli($data)
{
global $kurkodu;
//…
}

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

4 + 17 =

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?