Hello,
The problem you have is a way the syntax is written. In JavaScript you mix PHP. For your case this to work you will need to cahnge the script from
|
$mylabels = <<<LABELS $grid->jqGrid('setLabel','StartDate', 'Start Date', array('text-align' => 'left')); $grid->jqGrid('setLabel','EndDate', 'End Date', array('text-align; =>'right')); LABELS; // Output the function with setJSCode $grid->setJSCode($mylabels); |
to
|
$mylabels = <<<LABELS $("#grid").jqGrid('setLabel','StartDate', 'Start Date', {'text-align': 'left'} ); $("#grid").jqGrid('setLabel','EndDate', 'End Date', {'text-align': 'right'}); LABELS; // Output the function with setJSCode $grid->setJSCode($mylabels); |
Another possible solution is to use callGridMethod like this
|
... $grid->callGridMethod('#grid', 'setLabel', array("EndDate", "End Date", array("text-align"=>"right"))); |
Kind Regards,
Will