Keyword

[SOLVED] Re: K2 front-end save and close

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 5 months ago #66528 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 front-end save and close
Hello Neil,

Thank you for your input, but I think there are several solutions posted on this thread.
If you are still facing issues you should describe your setup and the exact nature of the bug (JS, etc) to provide some insight.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago - 11 years 5 months ago #66529 by Robert
Replied by Robert on topic Re: K2 front-end save and close
Same problem here. Originally posted on here about this but havn't received a reply yet (my post) .

Using K2 2.6 and Joomla 3 with a T3 framework template.

When I use a defoult J3 template it works fine, load my custom T3 template and edit screen crumbles to pieces. Layout is messed up and SAVE and CLOSE buttons do nothing : (

Okey I suspect it's this jQuery people keep talking about on here. BUT the thing is I'm not sure how to check if it's loading first or not. I have Coda2 and firebug. Could anyone please point mein the right direction or explains how to check for this in basic terms. How do I know what loads first and if JQuery is conflicting ???????

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago - 11 years 5 months ago #66530 by Robert
Replied by Robert on topic Re: K2 front-end save and close
Doing some testing and using firebug.

Turned off jQuery, I think? and getting these errors in firebug.

ReferenceError: jQuery is not defined
[Break On This Error]

$(window).load(function(){

what-i...rthship (line 636)

ReferenceError: jQuery is not defined
[Break On This Error]

var $K2 = jQuery.noConflict();

k2.js (line 9)

TypeError: $K2 is not a function
[Break On This Error]

$K2(document).ready(function() {

what-i...rthship (line 53)

TypeError: $(...).load is not a function
[Break On This Error]

$(window).load(function(){

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 5 months ago #66531 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 front-end save and close

Okey I suspect it's this jQuery people keep talking about on here. BUT the thing is I'm not sure how to check if it's loading first or not. I have Coda2 and firebug. Could anyone please point mein the right direction or explains how to check for this in basic terms. How do I know what loads first and if JQuery is conflicting ???????


You just need to open the source code and see the order of the scripts.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #66532 by Robert
Replied by Robert on topic Re: K2 front-end save and close
I see what you're saying. I tried for hours to get this conflict resolved but just couldn't. I"m giving up on K2 even though it's a popular extension for managing content I just can't get it working. : /

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #66533 by Michael Mason
Replied by Michael Mason on topic Re: K2 front-end save and close
I've tried everything here. No joy.

Really disappointed in K2. Time for a review I think.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #66534 by Nikos
Replied by Nikos on topic Re: K2 front-end save and close

kunle wrote: K2 v2.6.2
Php 5.3.10
MySQL 5.5.20
Joomla 2.5.8

I'm currently building a site offline using wampserver so after installing K2 I noticed neither 'Save & Close' nor 'Save & New' buttons worked in back-end.

Then in the JS error console (using firefox browser) I noticed these errors:

Get ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js

X ReferenceError: jQuery is not defined

Get ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js

X TypeError: $K2 is not a function

Since the system is not connected to internet I guessed the 'http' header for 'googleapis' might be the cause so here's what I did that fixed it:

Navagated to K2 Parameter i.e.
Parameters > Layouts & Views > CSS & JavaScript Settings > Backend jQuery & jQuery UI handling

By default it was set to 'Load a remote copy of jQuery & UI' so I switched this to 'Load a local copy of jQuery & UI' then saved the settings. Now the 'Save & Close' and 'Save & New' buttons works fine.

Went back to JS error console (using firefox browser) refreshed the screen and
'X ReferenceError: jQuery is not defined' and
'X TypeError: $K2 is not a function' errors are not shown anymore.

As soon as my site is developed & put on a hosting server I shall switch back to 'Load a remoted copy of jQuery UI to see If the error will return.


Thank you very much man that did the trick for me. So we have to use still the 1.8.x version of jquery in order to save and create items in frontend and of course to check permissions!
Merry Christmas everybody!

Please Log in or Create an account to join the conversation.

More
10 years 6 days ago #66535 by Dimitris
Replied by Dimitris on topic Re: K2 front-end save and close
The solution is quite simple actually.

All you need to do is add an ID to the close button in itemform.php:

<td id="toolbar-cancel" class="button">
<a class="toolbar" id="closebtn" href="#">.................

and then go up and after
submitform( pressbutton );

just add: jQuery('#closebtn').click();

Now when you click save, it will also click close :-)

Please Log in or Create an account to join the conversation.

More
10 years 19 hours ago #66536 by Dimitris
Replied by Dimitris on topic Re: K2 front-end save and close
Actually my solution doesn't quite work because we have to wait for the responce that the item is actually saved..

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum