ajaxboy / cjax

Lightweight Ajax Framework built in PHP with no foot-print. Allows you to build ajax functionality with a single line of code & do so much more, right from the back-end!
http://cjax.sourceforge.net/
66 stars 27 forks source link

Overlay + Tab Support? #38

Open Maeggi opened 8 years ago

Maeggi commented 8 years ago

Cjax is a great Ajax Framework :+1: But, i miss a Tab-Tool or Demo :) Have any a Idea for Overlay + Tab?

Thanks

ajaxboy commented 8 years ago

Hi Maeggi, no problem!, be sure to give it a star? :)

Me and @HallofFamer were actually discussing a plugin for tabs.

There is not tab function right now, but it is extremely easy to create one.

Cjax plugin system lets you import js/css, etc , so basically what you would need to do is find online a tool you like or tab demo online, and convert it into Cjax. I know it sounds hard, but it quite simple. Mostly everything is already done for you, if you look at files inside the plugin directory.

If you take a look the plugins directory (cjax/plugins/), open up - for example - autocomplete/autocomplete.js spin/spin.js , pagination/pagination.js , etc,

you'll notice that they share many things in common, some of them actually integrate 3rd party tools, import dependency files, etc.

So just take a 3rd party tabs tool and integrate it as a plugin.

All you need to do is import+usage, for this, create plugin call it whatever you want to call it , say you name it tabs as in cjax/plugins/tabs/tabs.js. Just copy of of the other existing plugins, rename everything to tabs, change the imports to reflect the actual file(s) that your wish to import, and done.

Now, all you have to do is change the main function tabs().

Add there code that the tabs use to initiate, and you are done, you can now call it with Cjax and pass parameters.

$ajax->tabs();

Let me know if this is something you can jump into, or if you may need assistance.

ajaxboy commented 8 years ago

ahh I had overlooked that you meant tabs within the overlay.....

Umm, there is not built-in tabs within the Overlays, and if there was - they would work not only for the overlay, they would work everywhere...

If you follow the previous instructions, you can further add things to the overall this way:

Using the new callback methods, the overlay supports new callback method 'overlayPop':

Example: $ajax->on('overlayPop', $ajax->run_something_after_overlay_was_created());

Maeggi commented 8 years ago

Thank You... I check this :+1: