Yiibooster

The option ‘tags’ is expecting an array of strings and not an associative array as returned by listData().

Add the following function to your model class (‘Place’)




function getColumn2Array($attribute=null) 

{

	if(self::model()->hasAttribute($attribute) == false) return '';


	$criteria = new CDbCriteria();

	$criteria->select = 'DISTINCT '.$attribute; //no need for repetitive data here

	$criteria->order = $attribute.' ASC';

	$results = self::findAll($criteria);

        $data = array();

        foreach($results as $result)

		$data[] = $result[$attribute];

	return $data;

}



Note: Yii does not yet have a build-in function like this for ActiveRecords.

Then, adjust the ‘tags’ line accordingly




'tags' => $model->getColumn2Array('name'),

Thanks a lot.

It’s Rock…

Hi guys,

great work!

I got 3 questions / feature requests which are inspired by magentos backend user interface and the list-mode they use.

  1. Within TbExtendedGridView: For example when searching for product-ids. Would it be possible to search for numbers between 1 and 30?

  2. Within TbExtendedGridView: Is is possible to have a generate a select box of the column values as a filter?

  3. Bulk-Actions: I saw that you already have some bulk action features. Magento has a cool feature on this one too: First of all the bulk actions are on top of the list. Furthermore it features a liste of actions and (if needed) an action-value input-field for extra target-value user-input.

For example: There might be a Select-Box for 3 Bulk-Actions "Delete/Change Category/Change Attribute". And then when you select a bulk action you can set the target bulk-value before pressing the button. For example: I select 10 products out of the list, select "change category" and enter a "10" for the category ID. Then I press the action button. BOOOM. Very powerful.

I think that this framework is really close to getting those features in. What do you guys think?

Kind regards

Mikey

Hi. Any updates on this one? I’m the only one with this issue?

Regards.

Two datePickerRow in a Form works in local PC but not in remote Server

Any solution is highly appreciable.

Thanks…

Hi …

i have a question… i want to make client validation in my form (yiibooster) i use the select2 widget in this way… and work very well…

View "Vista"







$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(

    'id' => 'proceso-form',

    'type' => 'horizontal',

    'enableAjaxValidation' => false,

    'enableClientValidation' => true,

    'htmlOptions' => array('class' => ''),

        ));


....




echo $form->select2Row($model, 'idcliente', array('hint'=>'Seleccione Uno','asDropDownList' => false,

            'options' => array(

                'width' => '100%',

                'closeOnSelect' => false,

                'placeholder' => 'Seleccione un cliente',

                'allowClear' => false,

                'ajax' => array(

                    'url' => Yii::app()->createUrl('proceso/cliente'),

                    'dataType' => 'json',

                    'data' => 'js:function(term,page) { return {q: term, page_limit: 10, page: page}; }',

                    'results' => 'js:function(data,page) { return {results: data}; }',

                ),

                )));

....

$this->endWidget();



Controller "Controlador"





public function actionCliente() {

        $cliente = Cliente::model()->findAll();

        $data = array();

        foreach ($cliente as $value) {

            $data[] = array(

                'id' => $value->id,

                'text' => $value->nombre." ".$value->apellido,

            );

        }

        echo CJSON::encode($data);

    }



my questions is… how i can make the client validation work… only work the server validation and… the pagination… really work =? i send the page by javascript but in my action i think mised something…

thanks

This is one of the best extensions for Yii. Is it still being updated? I don’t think the Yiibooster page has a donation button.

When using a DateRange, I noticed that when you click Apply, the mouse cursor can still be focused on the DateRange input field. When this happens the callback keeps being called. Any ideas how to unselect the field or limit the callback?




<?php echo $form->dateRangeRow($model, 'dateRangeField',

         array('hint'=>'Click inside! An even a date range field!.',

         'prepend'=>'<i class="icon-calendar">>/i>',

         'options' => array('callback'=>'js:function(start, end){console.log(start.toString("MMMM d, yyyy") + " - " + end.toString("MMMM d, yyyy"));}')

         )); ?>



Thanks,

James

I’ve the same question, and no-one actually replied to this previous post

Then add something to the question!

If you don’t get a response, it could be because the question sucks!

And/or lacks information.

Or, you need to keep the question warm for some time. By adding to it.

If you keep it warm by bumping it and complaining about not getting any response, you are doing it wrong.

You’re right but the question is clear: How to use the initSelection to fill the box with values from the database ?

I need an example of how to pass “something” to initSelection to ‘pre-select’ one or more options .

Sorry again

EDIT: I add this snippet from Select2.js; probably what we’re trying to do is simply not possible !





if (select) {

  // these options are not allowed when attached to a select because they are picked up off the element itself

  $.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () {

  if (this in opts) {

    throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a <select> element.");

  }

  });

} 

          



My application works very slow with this bootstrap. Any idea how i can fix that? I search this issue in this topic but found nothing. Sorry for my bad English.

Hi guys,

I hierby vote +one for a dedictated Yiibooster forum or forum-secion to make this more user friendly!

This Forum-Thread is really to big! I am sure there are a lot of questions about this great extension which should have their own forum.

What do you guys think?

Kind regards

Mikey

I second the motion for a dedicated yii booster section!

If You have your YII_DEBUG on - it is slow, when You switch it off it will be normal

+1 for this idea, but not only yiibooster but all bootstrap

You can create a Google group for it. It doesn’t warrant it’s own forum section here IMO.

Why not do a subcategory like this?


Yii Framework Forum

> Yii Framework Discussions

> Extensions

  > Yiibooster



That’s not going to solve anything. :)

First: people are shy. And will continue to post in the same topic, even if they get an entire subforum to post in.

Second: we already have enough trouble as it is to try and get people to post about Yii extensions in the Extensions forum. I don’t think adding to that complexity would be a good idea.

Third: what about other extensions? Shouldn’t they have their own subforum?

Fourth: it’s not worth it.

Ok - then I will just open a seperate topic within in the extension forum. I missunderstood it and thought that it was ment for developers to introduce their extensions… :slight_smile:

The only restriction we have here is that it be related to a Yii extension - so go ahead. :)