⚠ 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

Need to modify the add view



r00tkiit

r00tkiit
  • profile picture
  • Member

Posted 30 June 2012 - 11:17 AM

Hi Guys.

This is my first post here. Already inlove with Grocery Crud.

I want to make some modification with the "ADD" view. Please help me out.

I want something like this: http://prntscr.com/bcljp

Here, the first coulmn fields belong to the same column in the database.

Thanks.

fdias

fdias
  • profile picture
  • Member

Posted 01 July 2012 - 01:15 AM

If you use the default (flexigrid) theme then you can edit the files below:

assets\grocery_crud hemes\flexigrid\views\add.php
assets\grocery_crud hemes\flexigrid\views\edit.php

Cheers

r00tkiit

r00tkiit
  • profile picture
  • Member

Posted 01 July 2012 - 12:01 PM

[quote name='fdias' timestamp='1341105325' post='2515']
If you use the default (flexigrid) theme then you can edit the files below:

assets\grocery_crud hemes\flexigrid\views\add.php
assets\grocery_crud hemes\flexigrid\views\edit.php

Cheers
[/quote]
I dont want to change each and every view like above. I only want 1-2 views like I mentioned above.

fdias

fdias
  • profile picture
  • Member

Posted 01 July 2012 - 16:45 PM

I'm afraid there's no easy way of doing this. web-johnny please correct me if I'm wrong, but I believe you would need to change the function
showAddForm()
of the grocery_crud.php library (around line 1456) and have a condition before you call
$this->_theme_view('add.php',$data); 
in order to call your custom add views.

r00tkiit

r00tkiit
  • profile picture
  • Member

Posted 01 July 2012 - 17:45 PM

[quote name='fdias' timestamp='1341161125' post='2524']
I'm afraid there's no easy way of doing this. web-johnny please correct me if I'm wrong, but I believe you would need to change the function
showAddForm()
of the grocery_crud.php library (around line 1456) and have a condition before you call
$this->_theme_view('add.php',$data); 
in order to call your custom add views.
[/quote]

I can use this by session variables but the problem is how do I achieve the required functionality in my view. Can you please share some sample code with me to achieve my requirement.

r00tkiit

r00tkiit
  • profile picture
  • Member

Posted 01 July 2012 - 18:27 PM

I tried changing the ADD VIEW file myself and I am getting the following result.


[img]http://img577.imageshack.us/img577/6562/34d040c8e7d14d8ca3cd2f8.png[/img]

2nd dropdown box is buggy. I cant figure out why.

Please suggest me what to do.

fdias

fdias
  • profile picture
  • Member

Posted 01 July 2012 - 18:48 PM

You need to post your code, just by looking at the images we can only take a wild guess.

Lagluck

Lagluck
  • profile picture
  • Member

Posted 27 March 2019 - 18:57 PM

Great, that solved this problem for me...

Thank You!!!! r00tkiit

 

 

 

I'm afraid there's no easy way of doing this. web-johnny please correct me if I'm wrong, but I believe you would need to change the function

showAddForm()
of the grocery_crud.php library (around line 1456) and have a condition before you call
$this->_theme_view('add.php',$data);
in order to call your custom add views.