Example #1
0
 /** jqxdata.js is part of the jqwidgets.core package, no need to define its package and load it in init() function */
 public function run($return = false)
 {
     $options = array('datatype' => $this->dataType, 'datafields' => $this->parseDataFields($this->dataFields), 'id' => $this->id, 'root' => $this->root, 'url' => $this->url);
     $options = CMap::mergeArray($this->options, $options);
     $js = "var {$this->name} = " . XJSON::encode($options);
     if ($return) {
         return $js;
     } else {
         echo $js;
     }
 }
Example #2
0
 public function run()
 {
     $var = 'fdt_data_model' . $this->normalizeVariableName($this->id);
     $js = "\n        var {$var} = flight.component(fdtDataModel);\n        {$var}.attachTo(document,{\n            id : '{$this->id}',\n            gateway : '" . app()->urlManager->createUrl('/Xpress/service/ajax') . "',\n            connector: '{$this->connector}',\n            attributes : " . XJSON::encode($this->attributes) . "\n        });\n        ";
     cs()->registerScript('jqxDataSource_' . $this->id, $js, CClientScript::POS_READY);
 }
Example #3
0
<?php

$gridVar = 'fui_grid_' . $this->normalizeVariableName($this->id);
unset($options['source']);
?>
var <?php 
echo $gridVar;
?>
 = flight.component(fuiGrid);

<?php 
echo $gridVar;
?>
.attachTo('#<?php 
echo $this->id;
?>
',{
columns : <?php 
echo XJSON::encode($columns);
?>
,
options : <?php 
echo XJSON::encode($options);
?>
,
source : <?php 
echo XJSON::encode($source);
?>
,
});
Example #4
0
<?php

$var = 'fui_menu_' . $this->normalizeVariableName($this->id);
$html = strtr($html, array("\n" => '', "\n\r" => ''));
?>
$('body').append('<?php 
echo $html;
?>
');
var <?php 
echo $var;
?>
 = flight.component(fuiMenu);

<?php 
echo $var;
?>
.attachTo('#<?php 
echo $this->id;
?>
',{
    options : <?php 
echo XJSON::encode($options);
?>
,
    owner : $('<?php 
echo "#{$ownerId}";
?>
')
});
Example #5
0
?>
 = flight.component(fuiForm);

<?php 
echo $formVar;
?>
.attachTo('#<?php 
echo $this->id;
?>
',{
    dataModel : '<?php 
echo $this->dataModel;
?>
',
    dataVar : '<?php 
echo $this->dataVar;
?>
',
    fields : <?php 
echo XJSON::encode($this->fields);
?>
,
    buttons : <?php 
echo XJSON::encode($this->buttons);
?>
,
    rules : <?php 
echo XJSON::encode($this->rules);
?>
,
});