there’s a js file being pulled in that’s disrupting my jquery UI
Posted: 06 December 2010 03:23 AM   [ Ignore ]
Wallflower
Rank
Total Posts:  14
Joined  2010-12-02

I’m just wondering what this file is that’s pulled in as javascript..

/index.php?ACT=saef

On the page I’m working on (http://whereyouoff.to/index.php/home/index_editable) I have jQuery UI set up to reorder an unordered list. It behaves ok untill I bring in the safecracker form. When you drag an icon around to reorder everything goes wonky. I narrowed it down to that script. When I pull out the reference to it in a static copy of the page the problem is gone (http://whereyouoff.to/index_editable-static.html)


( I’m hoping to use the sortable of the jquery ui to work with safecracker and modify the sort order of my matrix field. Haven’t figure that part out yet tho =)

[ Edited: 06 December 2010 03:26 AM by Dave Joyce ]
Profile
 
 
Posted: 06 December 2010 09:57 PM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

You’re using a Matrix with your own custom sorting method? Why not use the built-in sortability?

Regarding ACT=saef. I have seen this on some systems before, where it takes 15-30 seconds to load. Others have see this behavior: http://expressionengine.com/forums/viewthread/172769/ This is an EE thing, and as far as I can tell theres’ no known fix. The only thing I’ve done with success is copying the source of ACT=saef and creating a flat file or static template, and referring to that instead of ACT=saef

Also, are you using the built-in jQuery module for adding jQuery UI to your page?

Profile
 
 
Posted: 06 December 2010 10:43 PM   [ Ignore ]   [ # 2 ]
Wallflower
Rank
Total Posts:  14
Joined  2010-12-02

I’m using Matrix with the built in sorting method, I just haven’t figure out how to read the input fields. I was going to do some trial and error but haven’t gotten that far yet.
I see in the generated Matrix form these fields…

<input type="hidden" name="my_custom_matrix[row_order][]" value="row_id_4" />
<
input type="hidden" name="my_custom_matrix[row_order][]" value="row_id_5" /> 

how can two rows have the same name though? What values do I put in those hidden fields to indicate where the rows should be?

 

But anyway, back to the saef file. If I copy the file and put it in a static file, how do I stop safecracker from trying to load it? Because it’s generated automatically with the {exp:safecracker channel="user_pages" entry_id="{entry_id}”} tag. I had to view the generated source to see it.

And no, I’m pulling in the jQuery UI myself. I couldn’t seem to get the built in tags working correctly. Would that make a difference you think?

Profile
 
 
Posted: 06 December 2010 11:00 PM   [ Ignore ]   [ # 3 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29
Dave Joyce - 06 December 2010 10:43 PM

I’m using Matrix with the built in sorting method, I just haven’t figure out how to read the input fields. I was going to do some trial and error but haven’t gotten that far yet.
I see in the generated Matrix form these fields…

<input type="hidden" name="my_custom_matrix[row_order][]" value="row_id_4" />
<
input type="hidden" name="my_custom_matrix[row_order][]" value="row_id_5" /> 

how can two rows have the same name though? What values do I put in those hidden fields to indicate where the rows should be?

Because the name ends in [], it is an array of values. I think the values you have are good.


But anyway, back to the saef file. If I copy the file and put it in a static file, how do I stop safecracker from trying to load it? Because it’s generated automatically with the {exp:safecracker channel="user_pages" entry_id="{entry_id}”} tag. I had to view the generated source to see it.

safecracker_head=“no” will prevent the form from adding the JS. Then you can do whatever manual JS you want.

And no, I’m pulling in the jQuery UI myself. I couldn’t seem to get the built in tags working correctly. Would that make a difference you think?

It probably wouldn’t, but hey, you never know smile

Profile
 
 
Posted: 06 December 2010 11:16 PM   [ Ignore ]   [ # 4 ]
Wallflower
Rank
Total Posts:  14
Joined  2010-12-02
Rob Sanchez - 06 December 2010 11:00 PM

Because the name ends in [], it is an array of values. I think the values you have are good.

Oh, I see. The Matrix row_order array is rebuilt from scratch each time you submit the form. So the sort order is defined by the order in which I build that array. I think that makes sense. Gee, programming is fun! raspberry Thanks for the lightbulb moment.

Rob Sanchez - 06 December 2010 11:00 PM

safecracker_head=“no” will prevent the form from adding the JS. Then you can do whatever manual JS you want.

cool, thanks. I’ll give that a try.

Profile