Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ConfiForms Form Definition
formNamef

 

titleTitletext

ordernrOrderNrnumber

records

ConfiForms TableView
formNamef
sortordernr ASC

ordernr

title

 

HTML
<script>
 
var fixHelperModified = function(e, tr) {
    var $originals = tr.children();
    var $helper = tr.clone();
    $helper.children().each(function(index) {
        AJS.$(this).width($originals.eq(index).width())
    });
    return $helper;
},
    updateIndex = function(e, ui) {
        AJS.$('td.cf_ordernr', ui.item.parent()).each(function (i) {
            AJS.$(this).html(i + 1);
			console.log('ui = ');
            console.log(ui);
        });
 
		AJS.$('td.cf_ordernr').each(function (i) {
			var entryId = AJS.$(this).attr('confi-data-id');
            console.log('entryId = ' + entryId);
            console.log('index i (i+1) = ' + (i+1));
 			//AJS.$.ajax({
        	//	url: 'https://wiki.vertuna.com/ajax/confiforms/rest/update.action?pageId=12222999&f=f&q=id:' + entryId + '&fv=ordernr:' + (i+1),
        	//	type: "GET",
            //    cache: false,
        	//	success: function (data) {
         	//	
        	//	}  
			//});
        });
    };



AJS.$(".cf_f_table tbody").sortable({
    helper: fixHelperModified,
    stop: updateIndex
}).disableSelection();
 
 
</script>