Yii Framework Forum: Yiibooster - Yii Framework Forum

Jump to content

  • (16 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last »
  • You cannot start a new topic
  • This topic is locked

Yiibooster Make it gorgeous. Do it Fast. Rate Topic: ***** 6 Votes

#41 User is offline   54byte 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 06-November 10

Posted 23 October 2012 - 09:58 AM

View PostAntonio Ramirez, on 23 October 2012 - 12:46 AM, said:

It seems that is due to the nature of the jquery.jeditable.js plugin itself (check line 326-329 of jquery.jeditable.js I think that $.extend is causing the conversion I am not sure).

We can try to modify its behavior by prepending the id with a string (ie: ID012829) and then remove it on the server or you could make use of the TbEditableColumn which is another (and personally cooler) way of having an edit in place. TbEditableColumn uses forms, so I believe it could help you more than TbJEditableColumn ( I have to track down this behavior where strings are converted to numbers )

Cheers


Ok.. i will try to use some trick for my problem.. thank you very much for your response antonio..

Cheers..
0

#42 User is offline   David Walker 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 21-August 12

Posted 24 October 2012 - 04:38 AM

Hi Antonio,

|Great extension. I am having some issues with the toggle Button. I want to place multiple toggle buttons on teh same row of a form. However when I add

<?php echo $form->toggleButtonRow($model, 'active'); ?>
<?php echo $form->toggleButtonRow($model, 'passive'); ?>


I get the two toggle buttons on individual rows. I have tried using
$form->toggleButton(...)
but it errors with "TbActiveForm and its behaviors do not have a method or closure named toggleButton"

Any ideas?

Thanks

David
0

#43 User is offline   Don Felipe 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 117
  • Joined: 02-January 11
  • Location:Saigon, Vietnam

Posted 25 October 2012 - 11:49 PM

Hi Antonio,

great extension! It's everything that yii-bootstrap has plus so much more. However, now I'm still missing something or I just haven't found it on your demo site yet.

Is it possible to use the Grid/Chart switcher button (or button group) without the chart but as common ajax buttons to toggle between whatever values? E.g. user list including status, no filter row, use button group to toggle between all/active/inactive users.

I have a manual solution for yii-bootstrap but the button group element is outside the gridview element and I have to use negative margin to display the button right above the grid. So, I'm wondering if there's an easier way using yii-booster?

Cheers,
Felipe
0

#44 User is offline   Don Felipe 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 117
  • Joined: 02-January 11
  • Location:Saigon, Vietnam

Posted 26 October 2012 - 12:08 AM

Another thing. Sorting GridView:

There's an arrow appearing when hovering on header titles. Is there an option to show the arrow of the column that is used for the current sort order? Besides, is it possible to have the grid sorted by multiple columns as well?
If not, any plans to add this feature in the future?

Thanks, again.
0

#45 User is offline   nkd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 28-September 12

Posted 27 October 2012 - 04:48 AM

Antonio, first of all thank you for your wonderful extension!

I have a question for you (or anyone who has the answer), how can I change the language of the TbDateRangePicker according to the language settings of my yii app?

Right now I had to hard code the name of the days in spanish into bootstrap-daterangepicker.js, and the name of the months (that for some reason are not taken from that same file), into date.js. But I need to do this dynamically depending on the language setting of the yii application (English/Spanish). How can I do this?

I am using the date picker as a filter for a grid like this:

...
 array(
 'name'=>'date_created',
 'filter'=>$this->widget('bootstrap.widgets.TbDateRangePicker', array(
                  'model'=>$model,
                  'attribute'=>'date_created'), 
                  true),
),
...


0

#46 User is offline   Suralc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 46
  • Joined: 10-January 12
  • Location:Germany

Posted 27 October 2012 - 06:02 AM

Just a question or observation. If I use the navbar with fixed set to true, the extension adds the wrong(read: non existant) class.


E.g.:

Quote

Added:
navbar navbar-inverse navbar-fixed-1


It's quite easy to fix in the application(just add "navbar-fixed-top" to the htmlOptions array, but a quick look at the sourcecode didn't reveal where the bug is related to).

Also I think there should be an option to automaticly apply
padding-top: 40px;
to the body tag, if fixed navbar is used.

But still epic extension (also thanks to the original author of yiiBootstrap ;) )

btw. are you planning to ship Bootstrap 2.1.2 as soon as it is released as 2.1.1 is not compatible with any non-js(made it compile on .net with js-context, buts thats not a solution) compiler?
0

#47 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 27 October 2012 - 02:27 PM

View Postnkd, on 27 October 2012 - 04:48 AM, said:

Antonio, first of all thank you for your wonderful extension!

I have a question for you (or anyone who has the answer), how can I change the language of the TbDateRangePicker according to the language settings of my yii app?

Right now I had to hard code the name of the days in spanish into bootstrap-daterangepicker.js, and the name of the months (that for some reason are not taken from that same file), into date.js. But I need to do this dynamically depending on the language setting of the yii application (English/Spanish). How can I do this?

I am using the date picker as a filter for a grid like this:

...
 array(
 'name'=>'date_created',
 'filter'=>$this->widget('bootstrap.widgets.TbDateRangePicker', array(
                  'model'=>$model,
                  'attribute'=>'date_created'), 
                  true),
),
...




In order to use internationalization for DateRangePicker you will have to provide the locale object to its options, so I recommend you to create a different locale for the different languages you use.

For example, for spanish:
$this->widget('bootstrap.widgets.TbDateRangePicker', array(
                  'model'=>$model,
                  'attribute'=>'date_created',
                  'options'=>array('locale'=>array(
                      'applyLabel'=>'Aplicar',
                      'fromLabel'=>'Desde',
                      'toLabel'=>'Hasta',
                      'customRangeLabel'=>'Personalizado',
                     'daysOfWeek'=>array('Do','Lu','Ma','Mi','Ju','Vi',Sa'),
                     'monthNames'=>array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'),
                     'firstDay'=>1
)), 
                     true,
),

Check bootstrap.daterangepicker.js file in asssets/js folder

Totally, untested!!!
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#48 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 27 October 2012 - 02:35 PM

View PostDon Felipe, on 26 October 2012 - 12:08 AM, said:

Another thing. Sorting GridView:

There's an arrow appearing when hovering on header titles. Is there an option to show the arrow of the column that is used for the current sort order? Besides, is it possible to have the grid sorted by multiple columns as well?
If not, any plans to add this feature in the future?

Thanks, again.


On your first question, is pure CSS... change its behavior: https://github.com/c...46d43e5d605be2a
You can also get the bootstrap.yii.css from Yii-Bootstrap extension, replace it and the arrow will be displayed as you wish

Yes!! and I have already done it, and even more... you will be able to actually save the filter for later use! The widget is TbExtendedFilter and will be included in version 1.0.4... Check the attached image for a snapshot on its behavior :)

Attached File(s)


¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#49 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 27 October 2012 - 02:38 PM

View PostSuralc, on 27 October 2012 - 06:02 AM, said:

Just a question or observation. If I use the navbar with fixed set to true, the extension adds the wrong(read: non existant) class.


E.g.:



It's quite easy to fix in the application(just add "navbar-fixed-top" to the htmlOptions array, but a quick look at the sourcecode didn't reveal where the bug is related to).

Also I think there should be an option to automaticly apply
padding-top: 40px;
to the body tag, if fixed navbar is used.

But still epic extension (also thanks to the original author of yiiBootstrap ;) )

btw. are you planning to ship Bootstrap 2.1.2 as soon as it is released as 2.1.1 is not compatible with any non-js(made it compile on .net with js-context, buts thats not a solution) compiler?


Please, any suggestions or code refactoring... help us on github!!! please!! :) rise the issues there and I will fix it asap!

About new bootstrap versions... we will update of course... whats the point of being obsolete :) ? We would like some help though!
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#50 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 27 October 2012 - 02:40 PM

View PostDavid Walker, on 24 October 2012 - 04:38 AM, said:

Hi Antonio,

|Great extension. I am having some issues with the toggle Button. I want to place multiple toggle buttons on teh same row of a form. However when I add

<?php echo $form->toggleButtonRow($model, 'active'); ?>
<?php echo $form->toggleButtonRow($model, 'passive'); ?>


I get the two toggle buttons on individual rows. I have tried using
$form->toggleButton(...)
but it errors with "TbActiveForm and its behaviors do not have a method or closure named toggleButton"

Any ideas?

Thanks

David


Provide me with the code and I will help you out!!! Show everything you have done here please (not too long code, just the issue section)
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#51 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 27 October 2012 - 02:43 PM

View PostDon Felipe, on 25 October 2012 - 11:49 PM, said:

Hi Antonio,

great extension! It's everything that yii-bootstrap has plus so much more. However, now I'm still missing something or I just haven't found it on your demo site yet.

Is it possible to use the Grid/Chart switcher button (or button group) without the chart but as common ajax buttons to toggle between whatever values? E.g. user list including status, no filter row, use button group to toggle between all/active/inactive users.

I have a manual solution for yii-bootstrap but the button group element is outside the gridview element and I have to use negative margin to display the button right above the grid. So, I'm wondering if there's an easier way using yii-booster?

Cheers,
Felipe


That shouldn't be a problem Felipe... The toggle button is just the regular widget at the Booster collection... now, the only thing you need to code is the actions of the toggle buttons and then a simple jquery script to handle the grid updates... I have to investigate how to do it a bit further... show me your code and i will try to help as much as i can 'AMIGO'
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#52 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 27 October 2012 - 02:44 PM

View PostDon Felipe, on 26 October 2012 - 12:08 AM, said:

Another thing. Sorting GridView:

There's an arrow appearing when hovering on header titles. Is there an option to show the arrow of the column that is used for the current sort order? Besides, is it possible to have the grid sorted by multiple columns as well?
If not, any plans to add this feature in the future?

Thanks, again.


is pure CSS... change its behavior: https://github.com/c...46d43e5d605be2a
You can also get the bootstrap.yii.css from Yii-Bootstrap extension, replace it and the arrow will be displayed as you wish

I am planning to support both methods instead of being automatic
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#53 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 27 October 2012 - 02:45 PM

New version of YiiBooster is out: current is 1.0.3
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#54 User is offline   nkd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 28-September 12

Posted 28 October 2012 - 04:41 AM

View PostAntonio Ramirez, on 27 October 2012 - 02:27 PM, said:

In order to use internationalization for DateRangePicker you will have to provide the locale object to its options, so I recommend you to create a different locale for the different languages you use.

For example, for spanish:
$this->widget('bootstrap.widgets.TbDateRangePicker', array(
                  'model'=>$model,
                  'attribute'=>'date_created',
                  'options'=>array('locale'=>array(
                      'applyLabel'=>'Aplicar',
                      'fromLabel'=>'Desde',
                      'toLabel'=>'Hasta',
                      'customRangeLabel'=>'Personalizado',
             		'daysOfWeek'=>array('Do','Lu','Ma','Mi','Ju','Vi',Sa'),
             		'monthNames'=>array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'),
             		'firstDay'=>1
)), 
             		true,
),

Check bootstrap.daterangepicker.js file in asssets/js folder

Totally, untested!!!


Thank you for the reply!

I have some comments:

1) monthNames does not take effect. not even hard coding the months in bootstrap.daterangepicker.js. I believe this is a bug. The month names are being taken from date.js. I wish I could help solving this bug but I am not good at all in javascript.

2) now I understand how to pass the locale object when declaring the widget, but how can I use different locale objects depending on the "language" variable of my config/main.php file?

Thank you again.

Edit: I already joined the development of yiibooster in git ;) I started my contribution by putting all the locales for the date.js component. I need some help to complete this because I do not know javascript. I am also new to git or any similar thing. I am finding it amazing.



0

#55 User is offline   nkd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 28-September 12

Posted 28 October 2012 - 06:36 AM

View PostSuralc, on 27 October 2012 - 06:02 AM, said:

Also I think there should be an option to automaticly apply
padding-top: 40px;
to the body tag, if fixed navbar is used.



According to the bootstrap documentation:

"...and remember to account for the hidden area underneath it by adding at least 40px padding to the <body>. Be sure to add this after the core Bootstrap CSS and before the optional responsive CSS."

I dont know if its the best solution, but I had to include the padding at the end of the assets/css/bootstrap.css file (if not the padding breaks with the responsive design).
I dont know how something that automatically adds that padding can be implemented, but yes I agree with you. Every time I add a new version of yii booster to my project I have to go back and modify the bootstrap.css again.

Antonio is right. You SHOULD join the github development. I already did.
0

#56 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 28 October 2012 - 02:43 PM

View Postnkd, on 28 October 2012 - 04:41 AM, said:

Thank you for the reply!

I have some comments:

1) monthNames does not take effect. not even hard coding the months in bootstrap.daterangepicker.js. I believe this is a bug. The month names are being taken from date.js. I wish I could help solving this bug but I am not good at all in javascript.

2) now I understand how to pass the locale object when declaring the widget, but how can I use different locale objects depending on the "language" variable of my config/main.php file?

Thank you again.

Edit: I already joined the development of yiibooster in git ;) I started my contribution by putting all the locales for the date.js component. I need some help to complete this because I do not know javascript. I am also new to git or any similar thing. I am finding it amazing.


You could be right that there is a bug within the plugin. I found my self debugging and fixing lots of them (one of the 'non-official' jeditable from jquery had a bunch for example).

About joining, great! do not worry for your pull requests... I will personally check your code and will modify if required (happens with some of them for current version), the best is that you join, share ideas, comments, in order to make it better and better for all of us.
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#57 User is offline   FlyBot 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 64
  • Joined: 20-January 09
  • Location:Ukraine

Posted 29 October 2012 - 03:39 AM

Hi there!
What you think about moving input widgets into static functions as CHtml? This is a major impact on their performance.
Sample:
    public static function label($label,$for,$htmlOptions=array()) {
		if(isset($htmlOptions['class']))
		    $htmlOptions['class'] .= ' control-label';
		else
		    $htmlOptions['class'] = 'control-label';
		return CHtml::label($label, $for, $htmlOptions);
	}


and

echo BootStrap::wrapControl(
		BootStrap::activeLabelEx($model, 'name'),
		BootStrap::activeTextField($model, 'name', 'Enter your name here...')
);


    public static function badge($text = '', $style = self::SIMPLE) {
	if($style != '')
	    $style = ' badge-'.$style;
	return "<span class='badge$style'>$text</span>";
    }

I have already implemented a wrapper for the basic functions, but it is hard work for one.
0

#58 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 29 October 2012 - 04:42 AM

View PostFlyBot, on 29 October 2012 - 03:39 AM, said:

Hi there!
What you think about moving input widgets into static functions as CHtml? This is a major impact on their performance.
Sample:
    public static function label($label,$for,$htmlOptions=array()) {
		if(isset($htmlOptions['class']))
		    $htmlOptions['class'] .= ' control-label';
		else
		    $htmlOptions['class'] = 'control-label';
		return CHtml::label($label, $for, $htmlOptions);
	}


and

echo BootStrap::wrapControl(
		BootStrap::activeLabelEx($model, 'name'),
		BootStrap::activeTextField($model, 'name', 'Enter your name here...')
);


    public static function badge($text = '', $style = self::SIMPLE) {
	if($style != '')
	    $style = ' badge-'.$style;
	return "<span class='badge$style'>$text</span>";
    }

I have already implemented a wrapper for the basic functions, but it is hard work for one.


You just named the new helper class I had in mind: TbHtml
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#59 User is offline   nkd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 28-September 12

Posted 29 October 2012 - 11:10 AM

After some days of playing with yiibooster I have found that responsive design is great but does not work for grids. It would be awesome to have a responsive grid, something like the one in this page:

http://css-tricks.co.../responsive.php

I do not know if this same trick could work for the yii grid but maybe something similar can be done.

For now, to make the experience of the grids in tablets or phones a little better , I managed to make some columns disappear like this:

...

array(
  'name'=>'date_modified',
  'htmlOptions'=>array('class'=>'hidden-tablet hidden-phone'), 
  'headerHtmlOptions'=>array('class'=>'hidden-tablet hidden-phone'),
 'filterHtmlOptions'=>array('class'=>'hidden-tablet hidden-phone'),
),
...


Maybe someone is wondering why I used "hidden-tablet hidden-phone" instead of "visible-desktop." Well, for some reason if I use the visible-desktop the grid design breaks. The hidden class works OK.

Anyway, this option works for hiding columns but the one I am suggesting would work for having the same columns displayed vertically. Grids are very useful and if someone is using bootstrap it is very probable he/she wants compatibility with all mobile devices, so the responsive gris is a must!
0

#60 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 29 October 2012 - 06:36 PM

View Postnkd, on 29 October 2012 - 11:10 AM, said:

After some days of playing with yiibooster I have found that responsive design is great but does not work for grids. It would be awesome to have a responsive grid, something like the one in this page:

http://css-tricks.co.../responsive.php

I do not know if this same trick could work for the yii grid but maybe something similar can be done.

For now, to make the experience of the grids in tablets or phones a little better , I managed to make some columns disappear like this:

...

array(
  'name'=>'date_modified',
  'htmlOptions'=>array('class'=>'hidden-tablet hidden-phone'), 
  'headerHtmlOptions'=>array('class'=>'hidden-tablet hidden-phone'),
 'filterHtmlOptions'=>array('class'=>'hidden-tablet hidden-phone'),
),
...


Maybe someone is wondering why I used "hidden-tablet hidden-phone" instead of "visible-desktop." Well, for some reason if I use the visible-desktop the grid design breaks. The hidden class works OK.

Anyway, this option works for hiding columns but the one I am suggesting would work for having the same columns displayed vertically. Grids are very useful and if someone is using bootstrap it is very probable he/she wants compatibility with all mobile devices, so the responsive gris is a must!


I totally agree with you, could you join to github and make the proposed changes on a pull request. We could include the modified classes on bootstra-yii.css
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

Share this topic:


  • (16 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last »
  • You cannot start a new topic
  • This topic is locked

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users