Yii 1.1: ajaxgii

A new AJAX CRUD generator for Yii framework.
25 followers

A new AJAX CRUD generator for Yii framework.

check a demo here

you can download the extension here:Download

Requirements

Bootstrap

Usage

Note:integrate bootstrap before doing this.

step1:Download the zip file and put it in your extensions directory.

step2:

'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'123',
                         'generatorPaths' => array(
                                                   'ext.ajaxgii', 
                                                 ),
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters'=>array('127.0.0.1','::1'),
        ),

eg: i have a table test(id,name,age).I have generated a crud for this.You can find a demo below.

Resources

GitHub

Credit goes to

1.bootstrap

i have used bootstrap's gii crud generator to make my customized giiplus crud generator.

2.TCPDF

For PDF generation i have integrated an extension with this crud generator

Name: TCPDF

Version: 5.9.157

Release date: 2012-04-16

Author: Nicola Asun

URLs: http: www.tcpdf.org

http:  www.sourceforge.net/projects/tcpdf

so im giving all the credits to Nicola Asun for this Pdf generation feature.

Regards,

Sirin K

www.nintriva.com

Total 16 comments

#15121 report it
Rajith R at 2013/10/09 03:16am
@sirin

Nice one :-)

Please write a wiki with step by step setup including bootstrap setup etc with links.

#14505 report it
sirin k at 2013/08/18 01:22pm
Some minor bugs are fixed

Some minor bugs are fixed.thanks for the support.

#12988 report it
naduvko at 2013/04/25 07:19am
Thanks

First of all, thanks for the good work. It was very usefull. Your Test table attributes are still in template, so they are causing an exception in View action. I suggest you to use attribute labels instead column names in export templates. I've done it with

CActiveRecord::model($this->model)->getAttributeLabel($column->name);

Not sure if it is good practice, but it worked :) Another suggestion is to consider using Eexcelview to export Excell. And the last problem is with access rules. If guest tries to access action which requires login, the whole login page is rendered below index.I solved it by using this article loginRequiredAjaxResponse.

#12403 report it
beesho at 2013/03/18 03:12pm
Minor Fix

Hello, I noticed that you have used "href='javascript:return;'" for the action links, which throws a js error. (although functionality is not affected) I recommend using "href='javascript:void(0);'" instead, as it is cleaner.

#12401 report it
beesho at 2013/03/18 12:09pm
Demo Link

Hello, Thanks for this nice extension. The demo link seems to be dead.. May you please re-create it?

#12314 report it
Imre at 2013/03/13 12:17pm
looks nice... but

Looking at the generated demo code in github. While this looks nice visually, I do not like how it looks in code.

You have presentation logic in controllers that should be in views. Views may need some love from DRY principle as at the moment it seems ajax and non-ajax versions are completely standalone (i may be wrong here)

Session for pdf/excel generation saves every time even tho users rarely generate pdf/excel. I do not understand why you are doing the lenghty Criteria setup (which is vulnerable to SQL injection btw) and Ajaxtest::model()->findAll($criteria); when you could do just $model->findAll();

Im sorry if i seem too negative, that is not my intention. Take it as friendly and free code review. Keep going on what you are doing.

#12289 report it
sirin k at 2013/03/11 12:40pm
@salsero:Input validation

@salsero:Input validation is working fine when both creating and updating records but whats the thing is when you try to update a record it is not showing you the validated errors.but if you are creating a new record it will show you the validated errors.

i did spend so many times to fix this issue,but was not able to figure out why this validated errors are not showing on the form when record updation.Please let me know if any of you guys are able to fix this issue.thanks

-Sirin

#12288 report it
sirin k at 2013/03/11 12:29pm
@skworden

@skworden:thanks for the report i have made this change in download file and git repo. too.

and you can use bootstrap like you do usually no change in that but make sure that you are using the latest prefix "Tb" for bootstrap widegts.

'preload'=>array('log','bootstrap'),
 
'components'=>array(
 
                'bootstrap'=>array(
                        'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
                        'coreCss'=>true, // whether to register the Bootstrap core CSS (bootstrap.min.css), defaults to true
                        'responsiveCss'=>false, // whether to register the Bootstrap responsive CSS (bootstrap-responsive.min.css), default to false
                        'plugins'=>array(
                                              // Optionally you can configure the "global" plugins (button, popover, tooltip and transition)
                                              // To prevent a plugin from being loaded set it to false as demonstrated below
                                        'transition'=>false, // disable CSS transitions
                                        'tooltip'=>array(
                                               'selector'=>'a.tooltip', // bind the plugin tooltip to anchor tags with the 'tooltip' class
                                               'options'=>array(
                                                         'placement'=>'bottom', // place the tooltips below instead
                                                              ),
                                                        ),
                                ),
                                  ),

thanks

#12287 report it
skworden at 2013/03/11 12:20pm
What bootstrap is this intended for?

I was just wondering which bootstrap this is intended to be used with?

I use this boostsrap. So you must register it in the top of all your view files or it wont work because it isn't preloaded so your page load times are faster but it has less extensions.

i.e.

<?php Yii::app()->bootstrap->register(); ?>
#12286 report it
skworden at 2013/03/11 12:09pm
Update bootstrapgenerator.php

FYI

Alias "application.extensions.giiplus.bootstrap.BootstrapCode" is invalid. Make sure it points to an existing PHP file and the file is readable.

need to change the line in bootstapgenterator.php

to use this ext. name

public $codeModel = 'application.extensions.ajaxgii.bootstrap.BootstrapCode';
#12277 report it
salsero at 2013/03/11 04:01am
input validation

it seem very nice but there is a validation of input data? i have put a string on "age" field but no error message is visualized ;)

#12247 report it
sirin k at 2013/03/09 02:21pm
@Mikey

Now im thinking about some awseome widgets in Yiibooster in my crud generator.i will posting its next version asap.thanks alot man.

-Sirin

#12245 report it
sirin k at 2013/03/09 02:05pm
seems like it will work.

Hi i havn't tried with Yiibooster but seems like it will work with yii booster too,ie you can use this "ajaxgii" folder instead of that gii dir inside Yiibooster also i have used most of the Yii-bootstrap widgets inside this code generator.so i dont see any issue on it.

-Sirin

#12243 report it
MikeyMiller at 2013/03/09 07:12am
Yiibooster support?

This looks great! Do you recon it will works with Yiibooster?

#12239 report it
sirin k at 2013/03/09 12:59am
thanks

thanks

#12238 report it
MAHESH.E.U at 2013/03/09 12:47am
nice one

Nice one man, expecting more of this type from you..

Leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet