Jump to content

scipt.aculo.us Drag & Drop and Fire Fox Question


cesarcesar

Recommended Posts

Hello Fellow Developers,

 

I am using the awesome drag and drop script found at http://script.aculo.us/. I have also added a modification that interacts to a db for reordering upon release of a dragable item. Within each dragable is a input checkbox. This checkbox holds a DB id value that is sent on submit. This process works fine in IE, but in FF the checkbox values dont get sent via GET, or POST. How do i get FF to react as i think it should, and IE does. Heres a little bit of code from the project beyond the standard script.aculo.us library. Thanks,

 

Interface Script

<?php /*   needed for IE   */ ?>
<div id="page">
<div id="sale_row" class="section">
	<div id="item_1" class="lineitem" style="cursor: move;">example 1 <input type="checkbox" name="check_value[]" value="example1"></div>
	<div id="item_2" class="lineitem" style="cursor: move;">example 2 <input type="checkbox" name="check_value[]" value="example2"></div>
</div>
</div>

<?php /*   set JS outside *page* div   */ ?>
<script type="text/javascript">
// <![CDATA[
sections = ['sale_row'];

<?php /*   this watches for event changes like drag and drop action   */ ?>
Event.observe(window,'load',init,false);
function init() {

	<?php /*   add a sortable.create for each group level div   */ ?>
	Sortable.create('sale_row',{tag:'div', dropOnEmpty:true, containment:sections, only:'lineitem', onUpdate:updateData});
}

Sortable.create('page',{tag:'div',only:'section',handle:'handle'});
// ]]>
</script>

 

*Javasript* that formats and sends url to ajax db update page. When chekbox vars "params" are sent this works perfectly.

function updateData() {
var params = '';
var sections = document.getElementsByClassName('section');
sections.each(function(section) {
	params = Sortable.serialize(section.id);
	var ajax = new Ajax.Request(page_url,{
		method: 'post',
		parameters: params
	});
});
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.