Support

Account

Home Forums ACF PRO How to disable drag&drop ordering function on a specific Repeaters field? Reply To: How to disable drag&drop ordering function on a specific Repeaters field?

  • Hi @golewis

    > how you added the JS file?

    Here is an instruction from ACF guys.
    https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/

    Also U better wrap javascript above with this code below avoiding JS error.
    if (typeof acf !== 'undefined') {}

    PS
    These codes below colorize the handle + replace title attribute.

    setTimeout(function(){
    	var target = $('.disable-sorting > .acf-input > .acf-repeater > .acf-table > tbody > .acf-row > .acf-row-handle.order');
    	target.css( {'cursor':'default', 'background-color':'#feffe5'} ).attr('title', 'Ordering disabled');
    }, 200);