⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Adding a Title to flexigrid



abradford

abradford
  • profile picture
  • Member

Posted 19 April 2012 - 21:17 PM

I saw an extra open space inside of flexigrid for table title, included a brief line of code to add a title if you set a subject for that title

under assets/grocery_crud/themes/flexigrid/views/list_template.php lines 25 - 27

I replaced


<div class="ftitle">
&nbsp;
</div>


With

<div class="ftitle">
<?php if(strtolower($subject) != 'record'): echo $subject; else: echo '&nbsp;'; endif; ?>
</div>


Just in case someone needs it!

fdias

fdias
  • profile picture
  • Member

Posted 10 June 2012 - 02:21 AM

Thanks a lot abradford!

I was just thinking about that.

web-johnny,

Could you please consider including this on your next release?
Perhaps you could have a config variable allowing to turn on/off this feature.

[edit]
PS. I just thought a little about this and ideally we would be able to set this on the crud creation function. Something like this:

$crud->set_table_title('TABLE TITLE GOES HERE'); default to empty then you wouldn't even need to have it on the config file.
[/edit]

I found this to be specially usefull when you minimize the tables, otherwise you wouldn't know which one is which until you maximize them.

Cheers.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 10 June 2012 - 13:57 PM

The new version is already planned. Perhaps in two releases from now. But still not promising anything :)

fdias

fdias
  • profile picture
  • Member

Posted 10 June 2012 - 14:36 PM

Thanks for considering it!

sachin vairagi

sachin vairagi
  • profile picture
  • Member

Posted 12 February 2013 - 17:33 PM

hello everyone,

 

 

I have set up table title for flexgrid theme,you just need to replace following files:-

 

1.assets\grocery_crud\themes\flexigrid\views[attachment=464:list_template.php]

2.application\libraries[attachment[attachment=465:grocery_crud.php]

 

 

 

in controller you can use it as follows:-

 

    function offices_management()
    {
        try{
            $crud = new grocery_CRUD();

            $crud->set_theme('flexigrid');
            $crud->set_table('offices');
            $crud->set_subject('Office');
            $crud->set_table_title('Office management');
            $crud->required_fields('city');
            $crud->columns('city','country','phone','addressLine1','postalCode');
            
            $output = $crud->render();
            
            $this->_example_output($output);
            
        }catch(Exception $e){
            show_error($e->getMessage().' --- '.$e->getTraceAsString());
        }
    }

 

 

cheers !!!!!
 


sachin vairagi

sachin vairagi
  • profile picture
  • Member

Posted 13 February 2013 - 18:24 PM

by using above library you can also give table title in datatables theme,

just open

assets\grocery_crud\themes\datatables\views->list_template.php

and write

<?php echo $table_title;?> around line no 102,title will be show above add button.


tlc033

tlc033
  • profile picture
  • Member

Posted 14 February 2013 - 00:39 AM

hello everyone,

 

 

I have set up table title for flexgrid theme,you just need to replace following files:-

 

1.assets\grocery_crud\themes\flexigrid\viewsattachicon.giflist_template.php

2.application\libraries[attachmentattachicon.gifgrocery_crud.php

 

 

 

in controller you can use it as follows:-

 

    function offices_management()
    {
        try{
            $crud = new grocery_CRUD();

            $crud->set_theme('flexigrid');
            $crud->set_table('offices');
            $crud->set_subject('Office');
            $crud->set_table_title('Office management');
            $crud->required_fields('city');
            $crud->columns('city','country','phone','addressLine1','postalCode');
            
            $output = $crud->render();
            
            $this->_example_output($output);
            
        }catch(Exception $e){
            show_error($e->getMessage().' --- '.$e->getTraceAsString());
        }
    }

 

 

cheers !!!!!
 

 

Error on line 29 add_edit_button_listener(); flexigrid.js Some conflicts on list_template.php  with other javascripts


sachin vairagi

sachin vairagi
  • profile picture
  • Member

Posted 14 February 2013 - 05:53 AM

hi tlc033,

 

thanks for considering my post. can you please give me a screenshot of that error ,i'll try to solve it..


sachin vairagi

sachin vairagi
  • profile picture
  • Member

Posted 14 February 2013 - 06:10 AM

i have tested my code again but still unable to find error, it will be helpful if you discribe eorror.


tlc033

tlc033
  • profile picture
  • Member

Posted 14 February 2013 - 08:40 AM

I have this error on line 29 flexigrid.js

 

ReferenceError: add_edit_button_listener is not defined

add_edit_button_listener();

 

P.S. it's posible error is on my side, conflict with some JS file, i well check this.


php_lover

php_lover
  • profile picture
  • Member

Posted 15 February 2013 - 05:02 AM

Fatal error: Call to undefined method grocery_CRUD::set_table_title()   give error


sachin vairagi

sachin vairagi
  • profile picture
  • Member

Posted 16 February 2013 - 09:30 AM

hi php_lover,

 

download the grocery_crud.php file from above post and replace it in your    application\libraries  folder

 

 

:)


php_lover

php_lover
  • profile picture
  • Member

Posted 20 February 2013 - 06:53 AM

Thanks Sachin


amityweb

amityweb
  • profile picture
  • Member

Posted 25 July 2013 - 14:25 PM

Just upgraded to v 1.3.3 and also getting:

Uncaught ReferenceError: add_edit_button_listener is not defined

 

Edit: I cleared my cache and its OK. Maybe its in the old version which was cached. 


Max Grafix

Max Grafix
  • profile picture
  • Member

Posted 01 December 2013 - 02:17 AM

Great work Sachin (Y)...