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

TOPIC: [SOLVED] Best way 2 ajaxify component using the Model&Ctrlr

Re: Best way 2 ajaxify component using the Model&Ctrlr 11 Oct 2012 11:10 #4408

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Sure, no problem... please feel free to open a topic for me - wasn't sure where to open it.

Like a number of forum users here (BTB3000, edwardcox, VeCrea and lots more), I will always try to help where I can. Not sure how many I solved as such but I definitely tried to help!

Anything I can do to help support the community!

1 suggestion - this may have been suggested before but I'm not sure - could we have some sort of polling on the forum? Or, maybe another component for suggestions & ratings?

ADD
  1. Maybe kunena has something built in to achieve this?
  2. OR
  3. Maybe the addition of a component like JVoteSystem found on the JED... Just found it from a quick search and on the positive note it also allows user comments and embedding of youtube videos which could mean it would take care of the whole process

END

Strangely, my expertise are not really in web development but in teaching and music/media production, and more specifically, using media and music to teach. Web development is just something that I've picked up along the way out of necessity really. Therefore, I think the best help I might be able to provide would be in the form of short, specific video tutorials... That's where I suppose a poll might come in;
  • propose a list of video tutorials to the community
  • community can request/propose more video tutorials
  • community votes for them
  • I could make them every N days/weeks according to the requests/votes
How does that sound?

Naturally, written instructions can accompany the tutorials too.

I'd be more than happy to add cook logos/branding to the videos too if you'd like?

I know it's not on the same subject, but you can see some of my video tuts on how students can use their MACs to make interesting study-aids here on youtube as an example of video tutorials.

The video demonstrates how to convert their text into speech automatically with a little automator script/app that I wrote, then add it to a music track in GarageBand to make studying anywhere with their iPODs/MP3 players easier and more fun.

Let me know what you think?

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 11 Oct 2012 12:31 by JoomGuy. Reason: --------ADD-------
The administrator has disabled public write access.

Re: Best way 2 ajaxify component using the Model&Ctrlr 11 Oct 2012 11:36 #4410

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Hi @admin,

Just emailed you about this suggestion also...
ADD
Found the right place to post it (I think):
www.j-cook.pro/forum/24-propose-your-ser...-forum-a-videos#4411
END

Cheers,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 11 Oct 2012 12:34 by JoomGuy. Reason: --------ADD-------
The administrator has disabled public write access.

Re: Best way 2 ajaxify component using the Model&Ctrlr 19 Dec 2012 14:38 #6188

  • soportedo
  • soportedo's Avatar
  • Offline
  • Junior Member
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
I found interesting the search ajax, now I'm facing that problem, need to do a ajax search. I know how to jquery ajax works but not very familiar with joomla/cook, but with examples would be very thankfull

I think it would be good to create a Section in forum called Tutorial, which has all the dumb / hard things to do in cook step by step, so we (new cookers) won't keep asking in threads =( , as I'm asking right now.

Regards.!
The administrator has disabled public write access.

Re: Best way 2 ajaxify component using the Model&Ctrlr 19 Dec 2012 14:48 #6191

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
It's not just new cooks that need help, honestly! ;)

We all need help sometimes...

Docs and tuts coming soon. As soon as V2.0 is stable we can begin to really build of a solid base without too many fundamental things changing. Things change fast here...

Videos too but all in the new year!

Best wishes,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 19 Dec 2012 20:41 by JoomGuy. Reason: Typo
The administrator has disabled public write access.

Re: Best way 2 ajaxify component using the Model&Ctrlr 15 Jul 2013 02:47 #10464

  • vivek
  • vivek's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 2
  • Karma: 2
Thanks Admin..Below instruction helps a lot.

But I am getting following error while calling http://localhost/cvv1/index.php?option=com_cvv&view=vvcitem&layout=ajax&render=subscribe

500 Layout ajax not found



admin wrote:
In the a case, all you need is to have models and controllers availables and working.
The controllers, receive the post of the ajax call (exactly the same)
The models, prepare and modify the datas (same as well)

All you need is to get the right SQL queries when you call objects, so if you didn't have created layouts for that, the predefined SQL queries will not be created.

So, to my opinion, the simpliest is to create all your fictive layouts, then delete them after download.
You must remove the template files (behind tmpl/ ), and the functions in the view.html.php refferring to that layouts.

IMPORTANT : As convention for the future of cook, when you deal with ajax, please set
layout=ajax
in the GET or POST query.

So you will arrive in the displayAjax() function of view.html.php, and inside, you can switch the result, using the 'render' var :
layout=ajax&render=myExample

Of course, this displayAjax() is automaticaly created for this view, when you decided to use Ajax for this context.
You can copy this function, but don't forget to add 'ajax' in the accepted layouts aliases in the display() function :
Ex :
if (!in_array($layout, array('default', 'ajax')))
	return;

Then what to do ?
When layout=ajax&render=myExample :

displayAjax() :
in the switch, add a case : 'myExample', and write everything here (a. or b. cases)

Call a model and setup the context query (a context query has been already defined, or create a new one)
Note : Use the state vars to define the context :
$model->setState('default.myExample'); //HERE, myExample can be different than render
Populate $myObject with this model (I don't explain in details what you already know)

in the b. case, you can use JDom to facilitate the rendering (see Ajax features, based on b. case)
and finish with :
jexit()


in the a. case, finish with :
jexit(json_encode($myObject))

That's all for PHP.
JS in another post... to be continued
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.129 seconds

Get Started