Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: [CLOSED] Buillder - Page - view field NAME and field LABEL

Re: Buillder - Page - view field NAME and field LABEL 16 Nov 2012 12:34 #5424

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Ah, right - sorry - I misunderstood!

OK, essentially, I think that you need to create a separate form with a new, unique id for your subitems. You'll need to do this in your jQuery that builds the additional elements for retrieving & displaying (or adding new sub-items). Then, you can grab both sets of data separately...

Does that help?

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: Buillder - Page - view field NAME and field LABEL 16 Nov 2012 13:17 #5427

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
I think I will add the existing subitems to the main-item form with php.

Than I will add new subitems to the main-item form with jQuery

I grab the whole form in the save function, do a parent::save($data) and do a custom save/update/delete routine for the subitems.

Thanks for thinking with me again! :-)
The administrator has disabled public write access.

Re: Buillder - Page - view field NAME and field LABEL 16 Nov 2012 13:27 #5428

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
No probs!

In the interest of helping everyone, I wonder if you might post your code and experience in this thread once you've tested it please?

many thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: Buillder - Page - view field NAME and field LABEL 16 Nov 2012 13:35 #5429

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
Of course!

Need to delever part of this project soon. But will implement this dynamical stuff lateron and if worthy post it here :-)

Thanks again.
Last Edit: 16 Nov 2012 13:36 by goslingcools.
The administrator has disabled public write access.
The following user(s) said Thank You: JoomGuy

Re: Buillder - Page - view field NAME and field LABEL 21 Nov 2012 09:26 #5546

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
The overwerk[] field is a subitem yes.

Yes I think definitivly that you should use this way.
But then I didn't tried before for the moment so I can't help you.

When you are using Ajax with cook, In facts everything is ready for that in models. So it is not a big deal.

The only thing you have to do is to catch the ajax call in the view : displayAjax(), so it will stop with a jexit(), and will only return a JSON string.

Even when you are returning nothing, return something in JSON for the error management. This is missing in Cook.

Cook do not handle such Ajax transactions controls, and didn't defined yet a definitive standard way to do it.
for the moment, the prefered format is :
{
	data:{},	// Returned JSON
	transaction:
	{
		exceptions: [] //Joomla Exceptions (errors, warnings, notices)
	}
}

Then data contain the result. (item, list, complete object... what you want)
Transaction can contain also a lot of informations else as you want, but try to keep this convention OR DISCUSS IT, because it is planned to integrate it in the displayAjax()


For the moment Cook only deals with raw HTML returns in displayAjax().

Note : displayAjax is created in the view files of every view (item or collection) that need to be returned such way.
If you want to create this function, you may add 'ajax' in the array() of accepted layouts (view constructor)

Then something nice to respect my convention is to use the var 'render' which is an unique name for this ajax call, it is a sort of context var, or can be understood like the 'layout' var when using ajax.

Hope it helps.

Last but not least :
I see this topic has derivated from its original purpose...

To answer your initial question :
You are right, I understand.
My opinion is the same than audibeid. You may not have that much redondency.
Your field names are tricky.

A nice app is often using short name vars. Not for optimization, but for readability. If you cannot name them shorter or better, I think it is because your database architecture can be improved.

I will not fix that for the moment.
What you can do is simple :
Remember that all the labels strings are parser in the languages files, so :
-> Use other labels temporaly, with abreviations for instance
-> Rename them in the language file.

And please use shorter field names.
With such var names, when you will start to join with others tables, the aliases names will be so long !!!
Coding is now a piece of cake
Last Edit: 21 Nov 2012 09:27 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: goslingcools
  • Page:
  • 1
  • 2
Time to create page: 0.069 seconds

Get Started