(Antonio) #1

Recently launched YiiBooster, YiiBooster is a collection of widgets that will ease the task of developing Yii applications, as well as, giving your application a little boost. Basically, YiiBooster tackles the most common challenges that Yii developers face while trying to enhance their applications.

Please, use this forum topic for questions about its use. For issues and bugs, please use Github: https://github.com/clevertech/YiiBooster/issues

(Kaushik Itdu) #2

Problem with TbPercentOfTypeGooglePieOperation in TbExtendedGridView

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(










CException: The "label" of a type must be defined.

How to define the type for my case?

Please help…

(Antonio) #3

As you can see on the following example:

'types' => array(





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.

(Xicond) #4

Pardon me to suggest a new widget from combination with jqgrid.

I am really interest on some ext that really complete with js tool and css


(Antonio) #5

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.

(Rj) #6

I have a question in regards to themeing/customization and using LESS. If I wanted to customize my theme (pretty much adjusting everything found in the “Customize Variables” section in the Twitter Bootstrap download page), what’s the best way to do it? Would it be to just customize it from Twitter Bootstrap? What about the other CSS that’s not TB related (e.g. jquery-ui related ones, bootstrap-yii.less?)?

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

(Antonio) #7

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.


(Sabitzhabit) #8

hai antonio, thanks for your nice extension…

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?


(Peterbrennen) #9


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…


Any ideas appreciated. Ideally I want to use this YiiBooster component rather than the CJuiDatePicker.


Peter, Liverpool

(Dniznick) #10

The php extension seems to hardcode the date format even though it appears to take a format option.

(Antonio) #11

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.

(Antonio) #12

Could you provide code example? Thanks!

(Peterbrennen) #13

Hola Antonio,

You deserve your ‘elite’ status :) thanks that worked perfectly. Lastly, is there a way to get the picker to close once a date is clicked? I have to click away at the moment.



(Sendi Novianto) #14

i have problem with Relation data when i use TbEditableCOlumn, can u help me please, thanx for the answer

this is my code

    $this->widget('bootstrap.widgets.TbGridView', array(

        'type'=>'striped bordered condensed',





        'enablePagination' => true,

        'pager' => array(

            'cssFile' => false,

            'header' => false,

            'firstPageLabel' => 'First',

            'prevPageLabel' => 'Previous',

            'nextPageLabel' => 'Next',

            'lastPageLabel' => 'Last',






                    $this->grid->dataProvider->pagination->pageSize + $row+1',






                'value'=>'date("d-m-Y H:i:s",strtotime($data->tgl))',





                'class' => 'bootstrap.widgets.TbEditableColumn',

                'name' => 'idBarang0.idJenisBarang0.nama', --> Error in this


                '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\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) ?

(Antonio) #15

Thats the way the plugin works… for that to happen, you will have to modify the actual jquery plugin code.

(Antonio) #16

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.


(Antonio) #17

Your relation is bound to an ID= NULL


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? 

(Sendi Novianto) #18

this is my code in search function i use

public function searchStok(&#036;baris)


	// Warning: Please modify the following code to remove attributes that

	// should not be searched.

	&#036;criteria=new CDbCriteria;




	&#036;criteria-&gt;compare('DATE_FORMAT(t.tgl,&quot;%d-%m-%Y %H:%i:%s&quot;)',&#036;this-&gt;tgl,true);




    &#036;criteria-&gt;select = array(

        't.jumlah as jumlah',

        'DATE_FORMAT(t.tgl,&quot;%d-%m-%Y %H:%i:%s&quot;) 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',


    &#036;criteria-&gt;with = array(

















    &#036;criteria-&gt;order='t.tgl desc';




	return new CActiveDataProvider(&#036;this, array(







in cgridview i can call this







but when i change to this


            'class' =&gt; 'bootstrap.widgets.TbEditableColumn',

            'name' =&gt; 'jenis',


            'editable' =&gt; array(

                'url' =&gt; &#036;this-&gt;createUrl('site/editable'),

                'placement' =&gt; 'right',

                'inputclass' =&gt; 'span3'



it say error (Model "Barangdetailmasuk" does not have attribute "jenis" ),

what must i do if data contain relation with other table ?

(Sabitzhabit) #19

this is my code :





	'type'=>'striped bordered',







			'jEditableOptions' => array(

	            'type' => 'text',

				'submitdata' => array('attribute'=>'deskripsi'),

	            'cssclass' => 'form',

	            'width' => '200px',








(Sabitzhabit) #20

i use bootstrap generator and every "_search.php" form will give button like this :

	<div class="form-actions">

		<?php $this->widget('bootstrap.widgets.TbButton', array(



		)); ?>


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(




		)); ?>


add ‘buttonType’=>‘submit’,