Yiibooster Make it gorgeous. Do it Fast.
#1
Posted 05 October 2012 - 08:59 AM

POPULAR
Please, use this forum topic for questions about its use. For issues and bugs, please use Github: https://github.com/c...iBooster/issues
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#2
Posted 05 October 2012 - 09:36 AM
First of all thanks for this great extension.
I am trying to implementing TbPercentOfTypeGooglePieOperation in TbExtendedGridView and my environment is:
A table named 'User' with a field 'join_date' and having CRUD generated.
'extendedSummary' => array(
'title' => 'join_date Statistics',
'columns' => array(
'join_date' => array(
'label'=>'join_date Statistics',
'types' => array(
User::model()->findAll(array(
'select'=>'join_date',
'distinct'=>true,
),'join_date','join_date'),
),
'class'=>'TbPercentOfTypeGooglePieOperation',
)
)
),CException: The "label" of a type must be defined.
How to define the type for my case?
Please help...
#3
Posted 05 October 2012 - 10:20 AM
bit0123, on 05 October 2012 - 09:36 AM, said:
First of all thanks for this great extension.
I am trying to implementing TbPercentOfTypeGooglePieOperation in TbExtendedGridView and my environment is:
A table named 'User' with a field 'join_date' and having CRUD generated.
'extendedSummary' => array(
'title' => 'join_date Statistics',
'columns' => array(
'join_date' => array(
'label'=>'join_date Statistics',
'types' => array(
User::model()->findAll(array(
'select'=>'join_date',
'distinct'=>true,
),'join_date','join_date'),
),
'class'=>'TbPercentOfTypeGooglePieOperation',
)
)
),CException: The "label" of a type must be defined.
How to define the type for my case?
Please help...
As you can see on the following example:
'types' => array(
'CSS'=>array('label'=>'Css'),
'JavaScript'=>array('label'=>'Js'),
'HTML'=>array('label'=>'html')
),
The types are an array where the 'KEYS' are actually the values to check for and they are required to have a label property set in an array. You are just returning an array of CActiveRecords and that doesnt work like this. I recommend you to create afunction that returns the types array as stated above.
In order to get the correct configuration array, I highly recommend you to check the code of the widget TbPercentOfTypeGooglePieOperation that is written within the TbExtendedGridView widget.
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#4
Posted 06 October 2012 - 08:53 AM
I am really interest on some ext that really complete with js tool and css
Thank
#5
Posted 06 October 2012 - 04:51 PM
xicond, on 06 October 2012 - 08:53 AM, said:
I am really interest on some ext that really complete with js tool and css
Thank
JQGrid is an excellent tool, but we would like to keep the Bootstrap lookalike and nowadays JQGrid has issues with this theme. If you find a way to include the widget with the possibility to have Bootstrap theme and does not have issues and/or conflicts. They will be added to it.
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#6
Posted 10 October 2012 - 01:23 AM
What's the safest way to make sure my customizations are applied throughout the entire library? Is it with LESS? And if so, do we just grab the *.less source files from Twitter Bootstrap and go from there?
I guess I'm looking for some kind of guide
Anyway, awesome work (and much thanks to Chris for kicking off the original extension)! I love the ease of use and functionality of Twitter Bootstrap and these extensions... but I'm horrible at applying a theme that will make my site a bit different from the other TB-based sites out there
#7
Posted 10 October 2012 - 10:16 AM
NkM, on 10 October 2012 - 01:23 AM, said:
What's the safest way to make sure my customizations are applied throughout the entire library? Is it with LESS? And if so, do we just grab the *.less source files from Twitter Bootstrap and go from there?
I guess I'm looking for some kind of guide
Anyway, awesome work (and much thanks to Chris for kicking off the original extension)! I love the ease of use and functionality of Twitter Bootstrap and these extensions... but I'm horrible at applying a theme that will make my site a bit different from the other TB-based sites out there
The library references to *.css files (check assets folder of the extension), I know that .less is a cool way to do many things, but I tend to use tools like: http://stylebootstrap.info/ which easiest my work on customizing... Also, Booster has many references to many libraries that do not use .less... I guess we need some volunteers to make such huge transformation.
Cheers
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#8
Posted 11 October 2012 - 09:14 PM
i use "tbjeditablecolumn" in my tbextendedgridview, its work fine.. but when i post "id" that start with "0", it cant read "0".
Ex : my id = "01122", when i check the post id with firebug, post id = "1122".
how can i fix this problem?
thanks...
#9
Posted 13 October 2012 - 06:10 AM
Area: YiiBooster
Widget: TblActiveForm
Issue: TblDatePicker
I cannot seem to display dates in UK format (dd/mm/yyyy) - the model attribute is loading the date in UK format, I am using this code:
echo $form->datepickerRow($model, 'date_inception',
array('hint'=>'Policy start date'
, 'prepend'=>'<i class="icon-calendar"></i>'
, 'format' => 'dd/mm/yyyy'
, 'weekStart'=> 1
)) ; The page is rendering this js all the time though...
jQuery('#UwLocalPolicy_date_inception').datepicker({'language':'en_us','format':'mm/dd/yyyy','weekStart':0});Any ideas appreciated. Ideally I want to use this YiiBooster component rather than the CJuiDatePicker.
Thanks,
Peter, Liverpool
Attached File(s)
-
YiiBooster DatePickerRow issue.jpg (23K)
Number of downloads: 101
#10
Posted 13 October 2012 - 10:53 AM
#11
Posted 14 October 2012 - 02:40 AM
Peter @ Liverpool, on 13 October 2012 - 06:10 AM, said:
Area: YiiBooster
Widget: TblActiveForm
Issue: TblDatePicker
I cannot seem to display dates in UK format (dd/mm/yyyy) - the model attribute is loading the date in UK format, I am using this code:
echo $form->datepickerRow($model, 'date_inception',
array('hint'=>'Policy start date'
, 'prepend'=>'<i class="icon-calendar"></i>'
, 'format' => 'dd/mm/yyyy'
, 'weekStart'=> 1
)) ; The page is rendering this js all the time though...
jQuery('#UwLocalPolicy_date_inception').datepicker({'language':'en_us','format':'mm/dd/yyyy','weekStart':0});Any ideas appreciated. Ideally I want to use this YiiBooster component rather than the CJuiDatePicker.
Thanks,
Peter, Liverpool
In order to use DatePicker plugin and some other widgets that require configuration options, please within the htmlOptions the 'options' key with the array of configuration options of that widget:
echo $form->datepickerRow($model, 'date_inception',
array('hint'=>'Policy start date'
, 'prepend'=>'<i class="icon-calendar"></i>'
, 'options'=>array('format' => 'dd/mm/yyyy' , 'weekStart'=> 1)
)) ;
When you have issues with other plugins, please check TbInputVertical and TbInputHorizontal to review the way different options are taken from htmlOptions to construct the widget. This was included in order to maintain bc widgets construction with Bootstrap library.
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#12
Posted 14 October 2012 - 02:41 AM
54byte, on 11 October 2012 - 09:14 PM, said:
i use "tbjeditablecolumn" in my tbextendedgridview, its work fine.. but when i post "id" that start with "0", it cant read "0".
Ex : my id = "01122", when i check the post id with firebug, post id = "1122".
how can i fix this problem?
thanks...
Could you provide code example? Thanks!
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#13
Posted 14 October 2012 - 05:52 AM
You deserve your 'elite' status
Gracias!
Peter
#14
Posted 14 October 2012 - 08:25 AM
this is my code
-------------------------------------
$this->widget('bootstrap.widgets.TbGridView', array(
'type'=>'striped bordered condensed',
'id'=>'isistok-grid',
'dataProvider'=>$model->searchStok(10),
'filter'=>$model,
'enableSorting'=>false,
'enablePagination' => true,
'pager' => array(
'cssFile' => false,
'header' => false,
'firstPageLabel' => 'First',
'prevPageLabel' => 'Previous',
'nextPageLabel' => 'Next',
'lastPageLabel' => 'Last',
),
'columns'=>array(
array(
'header'=>'No.',
'value'=>'$this->grid->dataProvider->pagination->currentPage*
$this->grid->dataProvider->pagination->pageSize + $row+1',
'htmlOptions'=>array('style'=>'text-align:center'),
),
array(
'name'=>'tgl',
'header'=>'Tanggal',
'value'=>'date("d-m-Y H:i:s",strtotime($data->tgl))',
'htmlOptions'=>array('style'=>'text-align:center'),
),
array(
'class' => 'bootstrap.widgets.TbEditableColumn',
'name' => 'idBarang0.idJenisBarang0.nama', --> Error in this
'sortable'=>false,
'editable' => array(
'url' => $this->createUrl('site/editable'),
'placement' => 'right',
'inputclass' => 'span3'
)
),
my relation table in the picture, what i want is data from jenisbarang->nama, in cgridview it work fine, but with TbEditableColumn, it cant detect relation
this is debug result
----------------------
Querying SQL: SELECT `idBarang0`.`idBarang` AS `t1_c0`, `idBarang0`.`idJenisBarang` AS `t1_c1`, `idBarang0`.`idUserLogin` AS `t1_c2`, `idBarang0`.`nama` AS `t1_c3`, `idBarang0`.`lokasi` AS `t1_c4`, `idBarang0`.`kode` AS `t1_c5`, `idBarang0`.`modal` AS `t1_c6`, `idBarang0`.`laba` AS `t1_c7`, `idBarang0`.`jumlah` AS `t1_c8`, `idBarang0`.`terjual` AS `t1_c9` FROM `barang` `idBarang0` WHERE (`idBarang0`.`idBarang`=:ypl0). Bound with :ypl0=NULL in D:\htdocs\plath\protected\extensions\bootstrap\widgets\TbEditableColumn.php (45) in D:\htdocs\plath\protected\views\transaksi\isiStok\admin.php (279) in D:\htdocs\plath\protected\controllers\TransaksiController.php (89) in D:\htdocs\plath\protected\modules\rights\components\RController.php (36) in D:\htdocs\plath\index.php (18)
-----------------
i dont know what about other editable, are they like this too (cant detect AR) ?
Attached File(s)
-
ar.png (20.08K)
Number of downloads: 43
#15
Posted 14 October 2012 - 02:15 PM
Peter @ Liverpool, on 14 October 2012 - 05:52 AM, said:
You deserve your 'elite' status
Gracias!
Peter
Thats the way the plugin works... for that to happen, you will have to modify the actual jquery plugin code.
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#16
Posted 14 October 2012 - 02:18 PM
masterthink, on 14 October 2012 - 08:25 AM, said:
this is my code
-------------------------------------
$this->widget('bootstrap.widgets.TbGridView', array(
'type'=>'striped bordered condensed',
'id'=>'isistok-grid',
'dataProvider'=>$model->searchStok(10),
'filter'=>$model,
'enableSorting'=>false,
'enablePagination' => true,
'pager' => array(
'cssFile' => false,
'header' => false,
'firstPageLabel' => 'First',
'prevPageLabel' => 'Previous',
'nextPageLabel' => 'Next',
'lastPageLabel' => 'Last',
),
'columns'=>array(
array(
'header'=>'No.',
'value'=>'$this->grid->dataProvider->pagination->currentPage*
$this->grid->dataProvider->pagination->pageSize + $row+1',
'htmlOptions'=>array('style'=>'text-align:center'),
),
array(
'name'=>'tgl',
'header'=>'Tanggal',
'value'=>'date("d-m-Y H:i:s",strtotime($data->tgl))',
'htmlOptions'=>array('style'=>'text-align:center'),
),
array(
'class' => 'bootstrap.widgets.TbEditableColumn',
'name' => 'idBarang0.idJenisBarang0.nama', --> Error in this
'sortable'=>false,
'editable' => array(
'url' => $this->createUrl('site/editable'),
'placement' => 'right',
'inputclass' => 'span3'
)
),
my relation table in the picture, what i want is data from jenisbarang->nama, in cgridview it work fine, but with TbEditableColumn, it cant detect relation
this is debug result
----------------------
Querying SQL: SELECT `idBarang0`.`idBarang` AS `t1_c0`, `idBarang0`.`idJenisBarang` AS `t1_c1`, `idBarang0`.`idUserLogin` AS `t1_c2`, `idBarang0`.`nama` AS `t1_c3`, `idBarang0`.`lokasi` AS `t1_c4`, `idBarang0`.`kode` AS `t1_c5`, `idBarang0`.`modal` AS `t1_c6`, `idBarang0`.`laba` AS `t1_c7`, `idBarang0`.`jumlah` AS `t1_c8`, `idBarang0`.`terjual` AS `t1_c9` FROM `barang` `idBarang0` WHERE (`idBarang0`.`idBarang`=:ypl0). Bound with :ypl0=NULL in D:\htdocs\plath\protected\extensions\bootstrap\widgets\TbEditableColumn.php (45) in D:\htdocs\plath\protected\views\transaksi\isiStok\admin.php (279) in D:\htdocs\plath\protected\controllers\TransaksiController.php (89) in D:\htdocs\plath\protected\modules\rights\components\RController.php (36) in D:\htdocs\plath\index.php (18)
-----------------
i dont know what about other editable, are they like this too (cant detect AR) ?
TbEditableColumn is extended from TbDataColumn > CDataColumn, so, could you please check whether the relation works with simple column before? I guess there is an issue with your SQL.
Cheers
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#17
Posted 14 October 2012 - 02:19 PM
// ON YOUR DEBUG!!!! SELECT `idBarang0`.`idBarang` AS `t1_c0`, `idBarang0`.`idJenisBarang` AS `t1_c1`, `idBarang0`.`idUserLogin` AS `t1_c2`, `idBarang0`.`nama` AS `t1_c3`, `idBarang0`.`lokasi` AS `t1_c4`, `idBarang0`.`kode` AS `t1_c5`, `idBarang0`.`modal` AS `t1_c6`, `idBarang0`.`laba` AS `t1_c7`, `idBarang0`.`jumlah` AS `t1_c8`, `idBarang0`.`terjual` AS `t1_c9` FROM `barang` `idBarang0` WHERE (`idBarang0`.`idBarang`=:ypl0). Bound with :ypl0=NULL <----- SEE?
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#18
Posted 14 October 2012 - 07:59 PM
Antonio Ramirez, on 14 October 2012 - 02:19 PM, said:
// ON YOUR DEBUG!!!! SELECT `idBarang0`.`idBarang` AS `t1_c0`, `idBarang0`.`idJenisBarang` AS `t1_c1`, `idBarang0`.`idUserLogin` AS `t1_c2`, `idBarang0`.`nama` AS `t1_c3`, `idBarang0`.`lokasi` AS `t1_c4`, `idBarang0`.`kode` AS `t1_c5`, `idBarang0`.`modal` AS `t1_c6`, `idBarang0`.`laba` AS `t1_c7`, `idBarang0`.`jumlah` AS `t1_c8`, `idBarang0`.`terjual` AS `t1_c9` FROM `barang` `idBarang0` WHERE (`idBarang0`.`idBarang`=:ypl0). Bound with :ypl0=NULL <----- SEE?
this is my code in search function i use
----------------------------------
public function searchStok($baris)
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('idBarangDetailMasuk',$this->idBarangDetailMasuk);
$criteria->compare('idBarang',$this->idBarang);
$criteria->compare('idUserLogin',$this->idUserLogin);
$criteria->compare('DATE_FORMAT(t.tgl,"%d-%m-%Y %H:%i:%s")',$this->tgl,true);
$criteria->compare('t.jumlah',$this->jumlah,true);
$criteria->compare('nama',$this->nama,true);
$criteria->compare('jns.nama',$this->jenis,true);
$criteria->select = array(
't.jumlah as jumlah',
'DATE_FORMAT(t.tgl,"%d-%m-%Y %H:%i:%s") as tgl',
'brg.nama as nama',
'jns.nama as jenis',
'(brg.modal+brg.laba) as harga',
'ifnull(sum(brg.jumlah-brg.terjual),0) as stok',
);
$criteria->with = array(
'idBarang0'=>array(
'select'=>array(),
'alias'=>'brg',
'with'=>array(
'idJenisBarang0'=>array(
'select'=>array(),
'alias'=>'jns',
),
),
'together'=>true,
),
);
$criteria->alias='t';
$criteria->together=true;
$criteria->group='t.idBarangDetailMasuk';
$criteria->having='stok>0';
$criteria->order='t.tgl desc';
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'pagination'=>array(
'pageSize'=>$baris,
),
));
}
-------------------------------------------
in cgridview i can call this
array(
'name'=>'jenis',
'header'=>'Jenis',
'value'=>'$data->jenis',
'htmlOptions'=>array('style'=>'text-align:center'),
),
but when i change to this
array(
'class' => 'bootstrap.widgets.TbEditableColumn',
'name' => 'jenis',
'sortable'=>false,
'editable' => array(
'url' => $this->createUrl('site/editable'),
'placement' => 'right',
'inputclass' => 'span3'
)
),
it say error (Model "Barangdetailmasuk" does not have attribute "jenis" ),
what must i do if data contain relation with other table ?
#19
Posted 14 October 2012 - 08:37 PM
Antonio Ramirez, on 14 October 2012 - 02:41 AM, said:
this is my code :
$this->widget('bootstrap.widgets.TbExtendedGridView',array(
'id'=>'kbki-subklas-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'type'=>'striped bordered',
'columns'=>array(
'id',
array(
'name'=>'deskripsi',
'class'=>'bootstrap.widgets.TbJEditableColumn',
'saveURL'=>$this->createUrl('myUrl),
'jEditableOptions' => array(
'type' => 'text',
'submitdata' => array('attribute'=>'deskripsi'),
'cssclass' => 'form',
'width' => '200px',
),
),
array(
'class'=>'bootstrap.widgets.TbButtonColumn',
),
),
));
#20
Posted 16 October 2012 - 09:04 PM
<div class="form-actions">
<?php $this->widget('bootstrap.widgets.TbButton', array(
'type'=>'primary',
'label'=>'Search',
)); ?>
</div>
because that button not a submit button when i click button, it dont do search. I think its better to change generate code to :
<div class="form-actions">
<?php $this->widget('bootstrap.widgets.TbButton', array(
'buttonType'=>'submit',
'type'=>'primary',
'label'=>'Search',
)); ?>
</div>
add 'buttonType'=>'submit',
thanks..

Help

This topic is locked











