Jump to content

via Ad Packs

Multiple Grids in one page.

multiple multi grid

  • Please log in to reply
33 replies to this topic

#1 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 925 posts
  • LocationLondon

Posted 16 June 2012 - 03:34 PM

A very interesting fork of grocery CRUD that with this extension you can easily have multiple grids at your project is the forked project https://github.com/Xrymz/grocery-crud commited by Дмитрий Рыбников also known with the username Xrymz

The installation it's easy , you just download the latest version from https://github.com/X.../zipball/master and you just copy the files at your Codeigniter project (the same thing that you do with the grocery CRUD installation). When this is done you can easily have a result that will look like this: multi-grid.png

An example of how using it you can see it below:

function multi()
{
   $GCM = new Grocery_crud_multi();

   $GCM->grid_add(1);

   $GCM->grids[1]->set_table('film');
   $GCM->grids[1]->set_subject('film');

   $GCM->grid_add(2);

   $GCM->grids[2]->set_table('products');
   $GCM->grids[2]->set_subject('products');

   $GCM->grid_add(3);

   $GCM->grids[3]->set_table('customers');
   $GCM->grids[3]->set_subject('customers');

   $output = $GCM->render();

   $this->_example_output_multi($output);
}
  
function _example_output_multi($output = null)
{
   if(is_array($output['output']))
	$output['output'] = implode(' ',$output['output']);
  
   $this->load->view('example.php',$output);
}  

Posted Image

#2 rteranm

rteranm

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 10 July 2012 - 12:53 AM

sorry to bother you, the code is great, I have a problem I DOWNLOAD these files but the styles do not load and I have other errors.

Thanks


A PHP Error was encountered
Severity:Notice
Message : Undefined variable : unic_id
Filename : view/list_template.php
Line Number : 33


#3 djbeemer

djbeemer

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 13 July 2012 - 12:43 PM

This works well. I have found a problem with it:

If I have 2 grids, and both have relations set, the relations from the first grid get applied to the second grid. and the query then crashes.

eg:
$details = new Grocery_crud_multi();

$details->grid_add(1);

$details->grids[1]->set_table('projects_events');
$details->grids[1]->set_subject('Project Event');
$details->grids[1]->set_relation('event_type_id','types_events','event_type_name');

$details->grid_add(2);

$details->grids[2]->set_table('projects_appliances');
$details->grids[2]->set_subject('Project Appliance');
$details->grids[2]->set_relation('room_id','types_rooms','room_name');
$details->grids[2]->set_relation('type_id','types_appliances','appliance_name');
$details->grids[2]->set_relation('make_id','types_makes','make_name');

$output = $details->render();

A Database Error Occurred

Error Number: 1054
Unknown column 'j5e891baf.event_type_name' in 'field list'
SELECT `projects_appliances`.*, j5e891baf.event_type_name AS s5e891baf, j8273f993.room_name AS s8273f993, j94757cae.appliance_name AS s94757cae, j14dd5396.make_name AS s14dd5396 FROM (`projects_appliances`) LEFT JOIN `types_rooms` as j8273f993 ON `j8273f993`.`room_id` = `projects_appliances`.`room_id` LEFT JOIN `types_appliances` as j94757cae ON `j94757cae`.`type_id` = `projects_appliances`.`type_id` LEFT JOIN `types_makes` as j14dd5396 ON `j14dd5396`.`makes_id` = `projects_appliances`.`make_id` LIMIT 25

Filename: /home/app/public_html/models/grocery_crud_model.php

Ive done some debugging in the model file, and found that the $this->relation array in the get_list function (when rendering the second grid) has the relation from the first grid included.

I was wondering if you could have a look at this??

The same happens when not using the multi plugin if i define the 2 tables manually.. and then render() twice.

#4 Xrymz

Xrymz

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 18 July 2012 - 11:50 AM

I'm sorry for not having replied, I now have a large workload at work (try a few days to see the error which occurred in you, and try to help solve them.

#5 rteranm

rteranm

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 19 July 2012 - 03:15 AM

This works well. I have found a problem with it:

If I have 2 grids, and both have relations set, the relations from the first grid get applied to the second grid. and the query then crashes.

eg:

$details = new Grocery_crud_multi();

$details->grid_add(1);

$details->grids[1]->set_table('projects_events');
$details->grids[1]->set_subject('Project Event');
$details->grids[1]->set_relation('event_type_id','types_events','event_type_name');

$details->grid_add(2);

$details->grids[2]->set_table('projects_appliances');
$details->grids[2]->set_subject('Project Appliance');
$details->grids[2]->set_relation('room_id','types_rooms','room_name');
$details->grids[2]->set_relation('type_id','types_appliances','appliance_name');
$details->grids[2]->set_relation('make_id','types_makes','make_name');

$output = $details->render();

A Database Error Occurred

Error Number: 1054
Unknown column 'j5e891baf.event_type_name' in 'field list'
SELECT `projects_appliances`.*, j5e891baf.event_type_name AS s5e891baf, j8273f993.room_name AS s8273f993, j94757cae.appliance_name AS s94757cae, j14dd5396.make_name AS s14dd5396 FROM (`projects_appliances`) LEFT JOIN `types_rooms` as j8273f993 ON `j8273f993`.`room_id` = `projects_appliances`.`room_id` LEFT JOIN `types_appliances` as j94757cae ON `j94757cae`.`type_id` = `projects_appliances`.`type_id` LEFT JOIN `types_makes` as j14dd5396 ON `j14dd5396`.`makes_id` = `projects_appliances`.`make_id` LIMIT 25

Filename: /home/app/public_html/models/grocery_crud_model.php

Ive done some debugging in the model file, and found that the $this->relation array in the get_list function (when rendering the second grid) has the relation from the first grid included.

I was wondering if you could have a look at this??

The same happens when not using the multi plugin if i define the 2 tables manually.. and then render() twice.




is true when relationships are blocked, not how to fix.

when you add or edit out the message in both tables

#6 Mkendi

Mkendi

    Newbie

  • Members
  • Pip
  • 1 posts
  • LocationIstanbul / Turkey

Posted 25 July 2012 - 07:39 AM

@web-johnny
Thank you for your amazing work.
Concerning this topic: may I assume, that this extention will part of the next offical release?

Thanks again
Mehmet
Istanbul / Turkey

#7 Xrymz

Xrymz

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 20 August 2012 - 11:25 AM

Hi all! I'm sorry that I was gone, there were family problems, 29 of discharged from the service and refurbished extension, remove all the bugs and to make working with the latest version grocerycrud)
Sorry for bad English)) thanks google translate)

#8 goFrendiAsgard

goFrendiAsgard

    Advanced Member

  • Members
  • PipPipPip
  • 137 posts

Posted 22 August 2012 - 08:28 AM

Wow, such a great work.... :)

No-CMS homepage : http://www.getnocms.com
No-CMS forum : http://www.getnocms.com/forum
No-CMS Github page : https://github.com/g...diAsgard/No-CMS

 

Please don't mix up No-CMS and groceryCRUD issues.
(eg: user authentication etc is No-CMS specific issue and has nothing to do with groceryCRUD)

 


#9 casachit

casachit

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 23 August 2012 - 07:03 AM

lots of bugs needed to be fix... won't work on file upload... :( I keep on getting following error


A PHP Error was encountered

Severity: Notice

Message: Undefined index: message_promt_delete_file

Filename: libraries/grocery_crud.php

Line Number: 3105


#10 noskov

noskov

    grocery CRUD Guru

  • Advanced Member
  • PipPipPip
  • 175 posts
  • LocationKiev

Posted 23 August 2012 - 11:44 AM

Hi, casachit
A few months ago there was a small typo in the language files, look at this commit when it was fixed. Probably you have different parts with different bug fixes...

#11 casachit

casachit

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 29 August 2012 - 04:59 PM

Hi, casachit
A few months ago there was a small typo in the language files, look at this commit when it was fixed. Probably you have different parts with different bug fixes...


thanks noskov.biz, but i still have problem with search ..its not working and refresh icon keeps on looping..

#12 casachit

casachit

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 31 August 2012 - 05:53 AM

Like I said refresh icon keeps on looping and search option won't work.... multi data grid... Please help needed as soon as possible...

Attached Thumbnails

  • multidatagrid.PNG


#13 noskov

noskov

    grocery CRUD Guru

  • Advanced Member
  • PipPipPip
  • 175 posts
  • LocationKiev

Posted 31 August 2012 - 11:20 AM

Hi, casachit, unfortunatelly I didn't try multiple grids extention, so I couldn't tell you where the problem is exectly. Try to find what causes that error. Look at your firebug for the server response: what happens when you try to delete the uploaded file. I suppose, that it also can be some small typo somewhere at the code, that prevent passing to the page the message about deleting. If is it possible at the multiple grids, try and play just with 1 (!) grid - have you got that error without multi functionallity?

Well, I hope that it will give you the idea, but as I said that is only the shots in the dark, cause I didn't used that extention.

#14 casachit

casachit

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 01 September 2012 - 07:04 AM

thanks noskov.biz, for your suggestion. But firebug didn't show any error... But I did find something in code..

$ci = &get_instance();
$seg = $ci->uri->segments;
$f = $ci->uri->segment(count($seg)-1);
$fv = $ci->uri->segment(count($seg));

In the grocery_crud_multi.php library, the above code shows that it is dependent on uri. If my url is much lengthier or shorter as a whole.. not as Xyrmz has when he created this library, then it will give error...

As a whole I would like to say its great extension but not feasible enough... But I did solve problem on the basis of my url... thanks to noskov.biz for your suggestion and Xyrmz for your effort to bring this up

#15 arif rh

arif rh

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 15 September 2012 - 07:49 AM

HI, casachit, do you use this Xrymz's extension just by copying grocery_crud_multi.php, without grocery_crud.php? If you do, (because maybe you have installed latest version of grocery CRUD), so you need to edit some lines in your grocery_crud.php file (related to unic_id variable) to make it works fine.

#16 Djoudi

Djoudi

    Member

  • Members
  • PipPip
  • 12 posts

Posted 28 September 2012 - 01:01 PM

me tow the same prb
<div class="flexigrid" id="grid_<div style=" border:1px="" solid="" #990000;padding-left:20px;margin:0="" 0="" 10px="" 0;"="">
A PHP Error was encountered

Severity: Notice
Message: Undefined variable: unic_id
Filename: views/list_template.php
Line Number: 33

#17 tlc033

tlc033

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts
  • LocationChisinau

Posted 16 December 2012 - 01:47 AM

Hi. What about implementation like this http://carbogrid.com...sample/multiple ???

We are a web company from Republic of Moldova and offers services as, web design, web development, eCommerce, online marketing and advertising, consulting and web optimization, search engine optimization (SEO) and social media optimization (SMO), branding and rebranding.

 

          logo_small.png  

                         elitiv.com  

                  

 

 


#18 php_lover

php_lover

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 12 March 2013 - 06:02 AM

It gives Fatal Error.Please help

Attached Thumbnails

  • grocery error.png


#19 victor

victor

    grocery CRUD Hero

  • Advanced Member
  • PipPipPip
  • 953 posts
  • LocationMinsk

Posted 12 March 2013 - 09:22 AM

did you put the file of this plugin in the library directory?

logo.jpg    www.svc.by


#20 php_lover

php_lover

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 12 March 2013 - 10:23 AM

Yes Victor i put the file in library







Also tagged with one or more of these keywords: multiple, multi grid

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users