wire/templates-admin/scripts/inputfields.js
/**
 * Event handler called when 'reload' event is triggered on an Inputfield
 * 
 */
Event handler called when 'reload' event is triggered on an Inputfield
Event handler called when ' reload ' event is triggered on an Inputfield
function InputfieldReloadEvent(event, extraData) {
	var $t = $(this);
	var $form = $t.closest('form');
	var fieldName = $t.attr('id').replace('wrap_Inputfield_', '');
	var fnsx = ''; 
	var url = $form.attr('action');
	if(fieldName.indexOf('_repeater') > 0) {
		var $repeaterItem = $t.closest('.InputfieldRepeaterItem'); 
		var pageID = $repeaterItem.attr('data-page');
		url = url.replace(/\?id=\d+/, '?id=' + pageID);
		fnsx = $repeaterItem.attr('data-fnsx');
		fieldName = fieldName.replace(/_repeater\d+$/, '');
	}
	url += url.indexOf('?') > -1 ? '&' : '?';
	url += 'field=' + fieldName + '&reloadInputfieldAjax=' + fieldName;
	if(fnsx.length) url += '&fnsx=' + fnsx;
	if(typeof extraData != "undefined") {
		if(typeof extraData['queryString'] != "undefined") {
			url += '&' + extraData['queryString'];
		}
	}
	consoleLog('Inputfield reload: ' + fieldName);
	$.get(url, function(data) {
		var id = $t.attr('id');
		var $content = jQuery(data).find("#" + id).children(".InputfieldContent");
		if(!$content.length && id.indexOf('_repeater') > -1) {
			id = 'wrap_Inputfield_' + fieldName;
			$content = jQuery(data).find("#" + id).children(".InputfieldContent");
			if(!$content.length) {
				console.log("Unable to find #" + $t.attr('id') + " in response from " + url);
			}
		}
		$t.children(".InputfieldContent").html($content.html());
		$t.trigger('reloaded', [ 'reload' ]);
	});
	event.stopPropagation();
}
function InputfieldReloadEvent ( event , extraData ) { var $t = $ ( this ) ; var $form = $t . closest ( 'form' ) ; var fieldName = $t . attr ( 'id' ) . replace ( 'wrap_Inputfield_' , '' ) ; var fnsx = '' ; var url = $form . attr ( 'action' ) ; if ( fieldName . indexOf ( '_repeater' ) > 0 ) { var $repeaterItem = $t . closest ( '.InputfieldRepeaterItem' ) ; var pageID = $repeaterItem . attr ( 'data-page' ) ; url = url . replace ( / \?id=\d+ / , '?id=' + pageID ) ; fnsx = $repeaterItem . attr ( 'data-fnsx' ) ; fieldName = fieldName . replace ( / _repeater\d+$ / , '' ) ; } url += url . indexOf ( '?' ) > - 1 ? '&' : '?' ; url += 'field=' + fieldName + '&reloadInputfieldAjax=' + fieldName ; if ( fnsx . length ) url += '&fnsx=' + fnsx ; if ( typeof extraData != "undefined" ) { if ( typeof extraData [ 'queryString' ] != "undefined" ) { url += '&' + extraData [ 'queryString' ] ; } } consoleLog ( 'Inputfield reload: ' + fieldName ) ; $ . get ( url , function ( data ) { var id = $t . attr ( 'id' ) ; var $content = jQuery ( data ) . find ( "#" + id ) . children ( ".InputfieldContent" ) ; if ( ! $content . length && id . indexOf ( '_repeater' ) > - 1 ) { id = 'wrap_Inputfield_' + fieldName ; $content = jQuery ( data ) . find ( "#" + id ) . children ( ".InputfieldContent" ) ; if ( ! $content . length ) { console . log ( "Unable to find #" + $t . attr ( 'id' ) + " in response from " + url ) ; } } $t . children ( ".InputfieldContent" ) . html ( $content . html ( ) ) ; $t . trigger ( 'reloaded' , [ 'reload' ] ) ; } ) ; event . stopPropagation ( ) ; }
Event handler called when 'reload' event is triggered on an Inputfield
Event handler called when ' reload ' event is triggered on an Inputfield
// field name suffix // if(typeof jQuery.ui != 'undefined') $t.effect("highlight", 1000); 