|
@@ -449,11 +449,11 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
props = $.extend({}, defaultsProps, props);
|
|
props = $.extend({}, defaultsProps, props);
|
|
|
funcNode = $('<a href="#" style="margin:0 2px;"></a>')
|
|
funcNode = $('<a href="#" style="margin:0 2px;"></a>')
|
|
|
;
|
|
;
|
|
|
- if ('href' in funObj) funcNode.attr('href', funObj.href.f(rowPK));
|
|
|
|
|
|
|
+ if ('href' in funObj) funcNode.attr('href', p5Utils__format(funObj.href, [rowPK]));
|
|
|
if (props.ico) {
|
|
if (props.ico) {
|
|
|
if ('ico' in funObj) funcNode.append('<span class="' + funObj.ico + '"></span>');
|
|
if ('ico' in funObj) funcNode.append('<span class="' + funObj.ico + '"></span>');
|
|
|
}
|
|
}
|
|
|
- if ('onclick' in funObj) funcNode.attr('onclick', funObj.onclick.f(rowPK));
|
|
|
|
|
|
|
+ if ('onclick' in funObj) funcNode.attr('onclick', p5Utils__format(funObj.onclick, [rowPK]));
|
|
|
if ('title' in funObj) funcNode.attr('title', funObj.title);
|
|
if ('title' in funObj) funcNode.attr('title', funObj.title);
|
|
|
if ('target' in funObj) funcNode.attr('target', funObj.target);
|
|
if ('target' in funObj) funcNode.attr('target', funObj.target);
|
|
|
|
|
|
|
@@ -952,7 +952,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
// console.log('FieldWidget: generate function to render field('+_fieldName+') ', fieldProps);
|
|
// console.log('FieldWidget: generate function to render field('+_fieldName+') ', fieldProps);
|
|
|
return function(val, fieldPK, row) {
|
|
return function(val, fieldPK, row) {
|
|
|
// console.log('FieldWidget: pk('+fieldPK+') run function to render field('+_fieldName+') with value('+val+') ', fieldProps);
|
|
// console.log('FieldWidget: pk('+fieldPK+') run function to render field('+_fieldName+') with value('+val+') ', fieldProps);
|
|
|
- return _format.f(val);
|
|
|
|
|
|
|
+ return p5Utils__format(_format, [val]);
|
|
|
}
|
|
}
|
|
|
}(fldName, fieldProps));
|
|
}(fldName, fieldProps));
|
|
|
break;
|
|
break;
|
|
@@ -964,7 +964,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
// console.log('FieldWidget: generate function to render field('+_fieldName+') ', fieldProps);
|
|
// console.log('FieldWidget: generate function to render field('+_fieldName+') ', fieldProps);
|
|
|
return function(val, fieldPK, row) {
|
|
return function(val, fieldPK, row) {
|
|
|
// console.log('FieldWidget: pk('+fieldPK+') run function to render field('+_fieldName+') with value('+val+') ', fieldProps);
|
|
// console.log('FieldWidget: pk('+fieldPK+') run function to render field('+_fieldName+') with value('+val+') ', fieldProps);
|
|
|
- return _format.f(val);
|
|
|
|
|
|
|
+ return p5Utils__format(_format, [val]);
|
|
|
}
|
|
}
|
|
|
}(fldName, fieldProps));
|
|
}(fldName, fieldProps));
|
|
|
break;
|
|
break;
|
|
@@ -975,7 +975,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
_formatByValue = _.get(_fieldProps, 'formatByValue', null);
|
|
_formatByValue = _.get(_fieldProps, 'formatByValue', null);
|
|
|
return function(val, fieldPK, row) {
|
|
return function(val, fieldPK, row) {
|
|
|
if (_formatByValue && val in _formatByValue) {
|
|
if (_formatByValue && val in _formatByValue) {
|
|
|
- return _formatByValue[val].f(val)
|
|
|
|
|
|
|
+ return p5Utils__format(_formatByValue[val], [val])
|
|
|
}
|
|
}
|
|
|
return val;
|
|
return val;
|
|
|
}
|
|
}
|
|
@@ -1023,7 +1023,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
// console.log('FieldWidget: generate function to render field('+_fieldName+') ', fieldProps);
|
|
// console.log('FieldWidget: generate function to render field('+_fieldName+') ', fieldProps);
|
|
|
return function(val, fieldPK, row) {
|
|
return function(val, fieldPK, row) {
|
|
|
// console.log('FieldWidget: pk('+fieldPK+') run function to render field('+_fieldName+') with value('+val+') ', fieldProps);
|
|
// console.log('FieldWidget: pk('+fieldPK+') run function to render field('+_fieldName+') with value('+val+') ', fieldProps);
|
|
|
- return _format.f(val);
|
|
|
|
|
|
|
+ return p5Utils__format(_format, [val]);
|
|
|
}
|
|
}
|
|
|
}(fldName, fieldProps));
|
|
}(fldName, fieldProps));
|
|
|
break;
|
|
break;
|
|
@@ -1047,7 +1047,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- return _format.f(valLink);
|
|
|
|
|
|
|
+ return p5Utils__format(_format, [valLink]);
|
|
|
}
|
|
}
|
|
|
}(fldName, fieldProps));
|
|
}(fldName, fieldProps));
|
|
|
break;
|
|
break;
|
|
@@ -1176,7 +1176,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
var check = _uniqueCols[props[_state.uniqueCol]] != undefined ? 'checked' : '';
|
|
var check = _uniqueCols[props[_state.uniqueCol]] != undefined ? 'checked' : '';
|
|
|
var checkable = props['checkable'] === false ? 'disabled' : '';
|
|
var checkable = props['checkable'] === false ? 'disabled' : '';
|
|
|
cellNode = $('<td></td>').appendTo(rowNode);
|
|
cellNode = $('<td></td>').appendTo(rowNode);
|
|
|
- $('<input class="unique" {0} {1} type="checkbox" />'.f(check, checkable)).appendTo(cellNode);
|
|
|
|
|
|
|
+ $(p5Utils__format('<input class="unique" {0} {1} type="checkbox" />', [check, checkable])).appendTo(cellNode);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (uniqueColName) rowNode.data('unique', rowPK);
|
|
if (uniqueColName) rowNode.data('unique', rowPK);
|
|
@@ -1217,7 +1217,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
if (columnProps._tsRetId) {
|
|
if (columnProps._tsRetId) {
|
|
|
showTooltip = false;
|
|
showTooltip = false;
|
|
|
if (columnProps._tsRetId > 0) {
|
|
if (columnProps._tsRetId > 0) {
|
|
|
- cellCnt.on('click', {id:rowPK, col:columnName, friendly:columnProps.friendly, value:format.f(val)}, priv.popoverCellTypeSpecial);
|
|
|
|
|
|
|
+ cellCnt.on('click', {id:rowPK, col:columnName, friendly:columnProps.friendly, value:p5Utils__format(format, [val])}, priv.popoverCellTypeSpecial);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1472,7 +1472,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
if (_state.uniqueCol && priv.options.checkboxes) {
|
|
if (_state.uniqueCol && priv.options.checkboxes) {
|
|
|
var checked = _checkToggleChecked ? 'checked' : '';
|
|
var checked = _checkToggleChecked ? 'checked' : '';
|
|
|
var headCell = $('<th></th>').appendTo(node);
|
|
var headCell = $('<th></th>').appendTo(node);
|
|
|
- var elem = $('<input {0} class="checkToggle" type="checkbox" />'.f(checked)).appendTo(headCell);
|
|
|
|
|
|
|
+ var elem = $(p5Utils__format('<input {0} class="checkToggle" type="checkbox" />', [checked])).appendTo(headCell);
|
|
|
elem.on('change', priv.checkToggleChanged);
|
|
elem.on('change', priv.checkToggleChanged);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1484,38 +1484,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
var headCell = $('<th class="ta-ordering"></th>').appendTo(node);
|
|
var headCell = $('<th class="ta-ordering"></th>').appendTo(node);
|
|
|
if (i == 1) headCell.addClass('stickyCol2');
|
|
if (i == 1) headCell.addClass('stickyCol2');
|
|
|
|
|
|
|
|
- if (false) {// TODO: old way
|
|
|
|
|
- var link = $('<a class="pull-left" href="#">{0}</a>'.f(props.friendly || column));
|
|
|
|
|
- link.on('click', {column: column}, priv.columnClicked).appendTo(headCell);
|
|
|
|
|
-
|
|
|
|
|
- if (props.tooltip) {
|
|
|
|
|
- $('<i class="glyphicon glyphicon-info-sign"></i>').tooltip({
|
|
|
|
|
- title: props.tooltip.trim(),
|
|
|
|
|
- html: true,
|
|
|
|
|
- container: 'body',
|
|
|
|
|
- placement: "top",
|
|
|
|
|
- delay: {
|
|
|
|
|
- show: 500,
|
|
|
|
|
- hide: 100
|
|
|
|
|
- }
|
|
|
|
|
- }).appendTo(link);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //Add sort arrow
|
|
|
|
|
- if (column == _state.filters.currSortCol) {
|
|
|
|
|
- if (_state.filters.currSortFlip) $('<i class="glyphicon glyphicon-chevron-down pull-right"></i>').appendTo(headCell);
|
|
|
|
|
- else $('<i class="glyphicon glyphicon-chevron-up pull-right"></i>').appendTo(headCell);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //Add hide btn
|
|
|
|
|
- if (column != 'ID') {
|
|
|
|
|
- var hideColBtn = $('<i class="glyphicon glyphicon-remove pull-right hover-show"></i>');
|
|
|
|
|
- hideColBtn.on('click', {column: column}, priv.columnHideClicked);
|
|
|
|
|
- hideColBtn.appendTo(headCell);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (props.type != 'special' && props.type != 'geom') {
|
|
|
|
|
|
|
+ if (props.type != 'special' && props.type != 'geom') { // TODO: props.isSortable
|
|
|
headCell.on('click', {column: column}, priv.columnClicked);
|
|
headCell.on('click', {column: column}, priv.columnClicked);
|
|
|
}
|
|
}
|
|
|
var colTitle = column;
|
|
var colTitle = column;
|
|
@@ -1528,9 +1497,9 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (props.friendly) {
|
|
if (props.friendly) {
|
|
|
- var headCnt = $('<span class="pull-left" title="{1}">{0}</span>'.f(props.friendly, colTitle));
|
|
|
|
|
|
|
+ var headCnt = $(p5Utils__format('<span class="pull-left" title="{1}">{0}</span>', [props.friendly, colTitle]));
|
|
|
} else {
|
|
} else {
|
|
|
- var headCnt = $('<span class="pull-left" title="{1}">{0}</span>'.f(column, colTitle));
|
|
|
|
|
|
|
+ var headCnt = $(p5Utils__format('<span class="pull-left" title="{1}">{0}</span>', [column, colTitle]));
|
|
|
}
|
|
}
|
|
|
headCnt.appendTo(headCell);
|
|
headCnt.appendTo(headCell);
|
|
|
|
|
|
|
@@ -1658,7 +1627,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
placeHolder = (placeHolder === true || placeHolder == undefined) ? '' : placeHolder === false ? '' : placeHolder;
|
|
placeHolder = (placeHolder === true || placeHolder == undefined) ? '' : placeHolder === false ? '' : placeHolder;
|
|
|
if (tooltip == undefined) tooltip = priv.options.types.number.filterTooltip;
|
|
if (tooltip == undefined) tooltip = priv.options.types.number.filterTooltip;
|
|
|
tooltip = (tooltip === true || tooltip == undefined) ? '' : tooltip === false ? '' : tooltip;
|
|
tooltip = (tooltip === true || tooltip == undefined) ? '' : tooltip === false ? '' : tooltip;
|
|
|
- elem = $('<input placeholder="{0}" class="filter" type="text" />'.f(placeHolder));
|
|
|
|
|
|
|
+ elem = $(p5Utils__format('<input placeholder="{0}" class="filter" type="text" />', [placeHolder]));
|
|
|
elem.on('keyup', {column: column}, priv.filterChanged);
|
|
elem.on('keyup', {column: column}, priv.filterChanged);
|
|
|
break;
|
|
break;
|
|
|
case "date":
|
|
case "date":
|
|
@@ -1666,7 +1635,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
placeHolder = (placeHolder === true || placeHolder == undefined) ? '' : placeHolder === false ? '' : placeHolder;
|
|
placeHolder = (placeHolder === true || placeHolder == undefined) ? '' : placeHolder === false ? '' : placeHolder;
|
|
|
if (tooltip == undefined) tooltip = priv.options.types.date.filterTooltip;
|
|
if (tooltip == undefined) tooltip = priv.options.types.date.filterTooltip;
|
|
|
tooltip = (tooltip === true || tooltip == undefined) ? '' : tooltip === false ? '' : tooltip;
|
|
tooltip = (tooltip === true || tooltip == undefined) ? '' : tooltip === false ? '' : tooltip;
|
|
|
- elem = $('<div><input placeholder="{0}" class="filter" type="text" /></div>'.f(placeHolder));
|
|
|
|
|
|
|
+ elem = $(p5Utils__format('<div><input placeholder="{0}" class="filter" type="text" /></div>', [placeHolder]));
|
|
|
|
|
|
|
|
if (priv.options.types.date.datePicker === true || priv.options.types.date.datePicker == undefined)
|
|
if (priv.options.types.date.datePicker === true || priv.options.types.date.datePicker == undefined)
|
|
|
{
|
|
{
|
|
@@ -1674,7 +1643,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
{
|
|
{
|
|
|
elem.addClass('date-wrap');
|
|
elem.addClass('date-wrap');
|
|
|
var today = 0;//new priv.ext.XDate(false).setHours(0, 0, 0, 0).toString('yyyy-MM-dd');
|
|
var today = 0;//new priv.ext.XDate(false).setHours(0, 0, 0, 0).toString('yyyy-MM-dd');
|
|
|
- var dp = $('<div style="float:right" class="date" data-date="{0}" data-date-format="{1}" />'.f(today, 'yyyy-mm-dd')).appendTo(elem);
|
|
|
|
|
|
|
+ var dp = $(p5Utils__format('<div style="float:right" class="date" data-date="{0}" data-date-format="{1}" />', [today, 'yyyy-mm-dd'])).appendTo(elem);
|
|
|
$('<input style="display:none" type="text" />').appendTo(dp);
|
|
$('<input style="display:none" type="text" />').appendTo(dp);
|
|
|
$('<span class="add-on"><i class="glyphicon glyphicon-chevron-right"></i></span>').on('click', {op: "l"}, priv.dpOpChanged).appendTo(dp);
|
|
$('<span class="add-on"><i class="glyphicon glyphicon-chevron-right"></i></span>').on('click', {op: "l"}, priv.dpOpChanged).appendTo(dp);
|
|
|
$('<span class="add-on"><i class="glyphicon glyphicon-chevron-left"></i></span>').on('click', {op: "r"}, priv.dpOpChanged).appendTo(dp);
|
|
$('<span class="add-on"><i class="glyphicon glyphicon-chevron-left"></i></span>').on('click', {op: "r"}, priv.dpOpChanged).appendTo(dp);
|
|
@@ -1700,7 +1669,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
placeHolder = (placeHolder === true || placeHolder == undefined) ? '%' : placeHolder === false ? '' : placeHolder;
|
|
placeHolder = (placeHolder === true || placeHolder == undefined) ? '%' : placeHolder === false ? '' : placeHolder;
|
|
|
if (tooltip == undefined) tooltip = priv.options.types.string.filterTooltip;
|
|
if (tooltip == undefined) tooltip = priv.options.types.string.filterTooltip;
|
|
|
tooltip = (tooltip === true || tooltip == undefined) ? 'Find str: str<br/>Find all but str: !str<br/>Find str inside: %str%' : tooltip === false ? '' : tooltip;
|
|
tooltip = (tooltip === true || tooltip == undefined) ? 'Find str: str<br/>Find all but str: !str<br/>Find str inside: %str%' : tooltip === false ? '' : tooltip;
|
|
|
- elem = $('<input placeholder="{0}" class="filter" type="text" size="8" />'.f(placeHolder));
|
|
|
|
|
|
|
+ elem = $(p5Utils__format('<input placeholder="{0}" class="filter" type="text" size="8" />', [placeHolder]));
|
|
|
elem.on('keyup', {column: column}, priv.filterChanged);
|
|
elem.on('keyup', {column: column}, priv.filterChanged);
|
|
|
break;
|
|
break;
|
|
|
case "special":
|
|
case "special":
|
|
@@ -1712,7 +1681,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
case "geom":
|
|
case "geom":
|
|
|
if (placeHolder == undefined) placeHolder = priv.options.types.string.placeHolder;
|
|
if (placeHolder == undefined) placeHolder = priv.options.types.string.placeHolder;
|
|
|
placeHolder = (placeHolder === true || placeHolder == undefined) ? '%' : placeHolder === false ? '' : placeHolder;
|
|
placeHolder = (placeHolder === true || placeHolder == undefined) ? '%' : placeHolder === false ? '' : placeHolder;
|
|
|
- elem = $('<input placeholder="{0}" class="filter" type="text" size="8" />'.f(placeHolder));
|
|
|
|
|
|
|
+ elem = $(p5Utils__format('<input placeholder="{0}" class="filter" type="text" size="8" />', [placeHolder]));
|
|
|
elem.on('keyup', {column: column}, priv.filterChanged);
|
|
elem.on('keyup', {column: column}, priv.filterChanged);
|
|
|
break;
|
|
break;
|
|
|
case "none":
|
|
case "none":
|
|
@@ -1790,7 +1759,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
var total = _data.total;
|
|
var total = _data.total;
|
|
|
var toRow = Math.min(fromRow + _state.pageSize, total);
|
|
var toRow = Math.min(fromRow + _state.pageSize, total);
|
|
|
if (_data.total > 0) {
|
|
if (_data.total > 0) {
|
|
|
- $('<p>Wiersze od {0} do {1} z {2}</p>'.f(fromRow + 1, toRow, total)).appendTo(node);
|
|
|
|
|
|
|
+ $(p5Utils__format('<p>Wiersze od {0} do {1} z {2}</p>', [fromRow + 1, toRow, total])).appendTo(node);
|
|
|
} else {
|
|
} else {
|
|
|
$('<p>Brak wierszy pasujących do kryteriów wyszukiwania</p>').appendTo(node);
|
|
$('<p>Brak wierszy pasujących do kryteriów wyszukiwania</p>').appendTo(node);
|
|
|
}
|
|
}
|
|
@@ -1817,33 +1786,33 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
if (lowerPage < 1) lowerPage = 1;
|
|
if (lowerPage < 1) lowerPage = 1;
|
|
|
if (upperPage < 5) upperPage = 5;
|
|
if (upperPage < 5) upperPage = 5;
|
|
|
|
|
|
|
|
- //$('<li class="{0}"><a href="#"><<</a></li>'.f(currPage == 1 ? 'disabled' : ''))
|
|
|
|
|
- $('<button type="button" class="btn btn-default{0}"><<</button>'.f(currPage == 1 ? ' disabled' : ''))
|
|
|
|
|
|
|
+ //$(p5Utils__format('<li class="{0}"><a href="#"><<</a></li>', [currPage == 1 ? 'disabled' : '']))
|
|
|
|
|
+ $(p5Utils__format('<button type="button" class="btn btn-default{0}"><<</button>', [currPage == 1 ? ' disabled' : '']))
|
|
|
.on('click', {pageIndex: 1}, priv.pageChanged)
|
|
.on('click', {pageIndex: 1}, priv.pageChanged)
|
|
|
.appendTo(node);
|
|
.appendTo(node);
|
|
|
- //$('<li class="{0}"><a href="#"><</a></li>'.f(currPage == 1 ? 'disabled' : ''))
|
|
|
|
|
- $('<button type="button" class="btn btn-default{0}"><</button>'.f(currPage == 1 ? ' disabled' : ''))
|
|
|
|
|
|
|
+ //$(p5Utils__format('<li class="{0}"><a href="#"><</a></li>', [currPage == 1 ? 'disabled' : '']))
|
|
|
|
|
+ $(p5Utils__format('<button type="button" class="btn btn-default{0}"><</button>', [currPage == 1 ? ' disabled' : '']))
|
|
|
.on('click', {pageIndex: currPage - 1}, priv.pageChanged)
|
|
.on('click', {pageIndex: currPage - 1}, priv.pageChanged)
|
|
|
.appendTo(node);
|
|
.appendTo(node);
|
|
|
|
|
|
|
|
for (var i = lowerPage; i <= upperPage; i++) {
|
|
for (var i = lowerPage; i <= upperPage; i++) {
|
|
|
var link;
|
|
var link;
|
|
|
- //if (i != currPage) link = $('<li class="{1}"><a href="#">{0}</a></li>'.f(i, i > totalPages ? 'disabled' : ''));
|
|
|
|
|
- if (i != currPage) link = $('<button type="button" class="btn btn-default{1}">{0}</button>'.f(i, i > totalPages ? 'disabled' : ''));
|
|
|
|
|
- //if (i == currPage) link = $('<li class="active"><a href="#">{0}</a></li>'.f(i));
|
|
|
|
|
- if (i == currPage) link = $('<button type="button" class="btn btn-default active">{0}</button>'.f(i));
|
|
|
|
|
|
|
+ //if (i != currPage) link = $(p5Utils__format('<li class="{1}"><a href="#">{0}</a></li>', [i, i > totalPages ? 'disabled' : '']));
|
|
|
|
|
+ if (i != currPage) link = $(p5Utils__format('<button type="button" class="btn btn-default{1}">{0}</button>', [i, i > totalPages ? 'disabled' : '']));
|
|
|
|
|
+ //if (i == currPage) link = $(p5Utils__format('<li class="active"><a href="#">{0}</a></li>', [i]));
|
|
|
|
|
+ if (i == currPage) link = $(p5Utils__format('<button type="button" class="btn btn-default active">{0}</button>', [i]));
|
|
|
|
|
|
|
|
if (link) {
|
|
if (link) {
|
|
|
link.on('click', {pageIndex: i}, priv.pageChanged);
|
|
link.on('click', {pageIndex: i}, priv.pageChanged);
|
|
|
link.appendTo(node);
|
|
link.appendTo(node);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //$('<li class="{0}"><a href="#">></a></li>'.f(currPage == totalPages ? 'disabled' : ''))
|
|
|
|
|
- $('<button type="button" class="btn btn-default{0}">></button>'.f(currPage == totalPages ? ' disabled' : ''))
|
|
|
|
|
|
|
+ //$(p5Utils__format('<li class="{0}"><a href="#">></a></li>', [currPage == totalPages ? 'disabled' : '']))
|
|
|
|
|
+ $(p5Utils__format('<button type="button" class="btn btn-default{0}">></button>', [currPage == totalPages ? ' disabled' : '']))
|
|
|
.on('click', {pageIndex: currPage + 1}, priv.pageChanged)
|
|
.on('click', {pageIndex: currPage + 1}, priv.pageChanged)
|
|
|
.appendTo(node);
|
|
.appendTo(node);
|
|
|
- //$('<li class="{0}"><a href="#">>></a></li>'.f(currPage == totalPages ? 'disabled' : ''))
|
|
|
|
|
- $('<button type="button" class="btn btn-default{0}">>></button>'.f(currPage == totalPages ? ' disabled' : ''))
|
|
|
|
|
|
|
+ //$(p5Utils__format('<li class="{0}"><a href="#">>></a></li>', [currPage == totalPages ? 'disabled' : '']))
|
|
|
|
|
+ $(p5Utils__format('<button type="button" class="btn btn-default{0}">>></button>', [currPage == totalPages ? ' disabled' : '']))
|
|
|
.on('click', {pageIndex: totalPages}, priv.pageChanged)
|
|
.on('click', {pageIndex: totalPages}, priv.pageChanged)
|
|
|
.appendTo(node);
|
|
.appendTo(node);
|
|
|
} else {
|
|
} else {
|
|
@@ -1865,9 +1834,9 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
$.each(priv.options.pageSizes, function(index, val) {
|
|
$.each(priv.options.pageSizes, function(index, val) {
|
|
|
var li = $('<li></li>').appendTo(ul);
|
|
var li = $('<li></li>').appendTo(ul);
|
|
|
if (val == priv.options.pageSize) {
|
|
if (val == priv.options.pageSize) {
|
|
|
- $('<a style="color:#337AB7;">{0}</a>'.f(val)).appendTo(li);
|
|
|
|
|
|
|
+ $(p5Utils__format('<a style="color:#337AB7;">{0}</a>', [val])).appendTo(li);
|
|
|
} else {
|
|
} else {
|
|
|
- $('<a href="#">{0}</a>'.f(val)).appendTo(li);
|
|
|
|
|
|
|
+ $(p5Utils__format('<a href="#">{0}</a>', [val])).appendTo(li);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
node.on('click', 'a', priv.pageSizeChanged);
|
|
node.on('click', 'a', priv.pageSizeChanged);
|
|
@@ -1909,7 +1878,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
if (props.type != "unique" && col != 'ID') {
|
|
if (props.type != "unique" && col != 'ID') {
|
|
|
var li = $('<li></li>').appendTo(ul),
|
|
var li = $('<li></li>').appendTo(ul),
|
|
|
label = (props.friendly || col).replace(/<br\/?>/g, ' '),
|
|
label = (props.friendly || col).replace(/<br\/?>/g, ' '),
|
|
|
- input = '<input {0} type="checkbox" title="{1}" value="{1}" style="margin:0"/> {2}'.f((props.hidden) ? '' : 'checked', col, label),
|
|
|
|
|
|
|
+ input = p5Utils__format('<input {0} type="checkbox" title="{1}" value="{1}" style="margin:0"/> {2}', [(props.hidden) ? '' : 'checked', col, label]),
|
|
|
a = $('<a href="#" style="padding:0px 20px;">' + input + '</a>').appendTo(li);
|
|
a = $('<a href="#" style="padding:0px 20px;">' + input + '</a>').appendTo(li);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1959,7 +1928,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
$.each(_data.cols, function(col, props) {
|
|
$.each(_data.cols, function(col, props) {
|
|
|
if (-1 !== priv.options.exportFields.indexOf(col)) {
|
|
if (-1 !== priv.options.exportFields.indexOf(col)) {
|
|
|
var li = $('<li></li>').appendTo(ul);
|
|
var li = $('<li></li>').appendTo(ul);
|
|
|
- $('<input {0} type="checkbox" title="{1}" value="{1}" > {2}</input>'.f((_exportFieldsSelect[col])? 'checked' : '', col, props.friendly || col)).appendTo(li);
|
|
|
|
|
|
|
+ $(p5Utils__format('<input {0} type="checkbox" title="{1}" value="{1}" > {2}</input>', [(_exportFieldsSelect[col])? 'checked' : '', col, props.friendly || col])).appendTo(li);
|
|
|
li.on('click', 'input', priv.exportFieldChanged);
|
|
li.on('click', 'input', priv.exportFieldChanged);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -2148,7 +2117,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (priv.options.debug) console.log('requesting data from url:{0} data:{1} L.<?php echo __LINE__; ?>'.f(priv.options.url, JSON.stringify(priv.options.urlData) || ''));
|
|
|
|
|
|
|
+ if (priv.options.debug) console.log(p5Utils__format('requesting data from url:{0} data:{1} L.<?php echo __LINE__; ?>', [priv.options.url, JSON.stringify(priv.options.urlData) || '']));
|
|
|
|
|
|
|
|
var initUrlAdd = '',
|
|
var initUrlAdd = '',
|
|
|
filtersInitSet = false;
|
|
filtersInitSet = false;
|
|
@@ -2761,7 +2730,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
priv.pageSizeChanged = function(e) {
|
|
priv.pageSizeChanged = function(e) {
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
var val = $(this).text();
|
|
var val = $(this).text();
|
|
|
- if (priv.options.debug) console.log('pagesize changed to:{0}'.f(val));
|
|
|
|
|
|
|
+ if (priv.options.debug) console.log(p5Utils__format('pagesize changed to:{0}', [val]));
|
|
|
|
|
|
|
|
if (parseInt(val) == priv.options.pageSize) {
|
|
if (parseInt(val) == priv.options.pageSize) {
|
|
|
return false;
|
|
return false;
|
|
@@ -2781,7 +2750,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
*/
|
|
*/
|
|
|
priv.columnClicked = function(e) {
|
|
priv.columnClicked = function(e) {
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
- if (priv.options.debug) console.log('col:{0} clicked'.f(e.data.column));
|
|
|
|
|
|
|
+ if (priv.options.debug) console.log(p5Utils__format('col:{0} clicked', [e.data.column]));
|
|
|
|
|
|
|
|
//set the new sorting column
|
|
//set the new sorting column
|
|
|
if (_state.filters.currSortCol == e.data.column) _state.filters.currSortFlip = !_state.filters.currSortFlip;
|
|
if (_state.filters.currSortCol == e.data.column) _state.filters.currSortFlip = !_state.filters.currSortFlip;
|
|
@@ -3149,7 +3118,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
|
|
|
|
|
//get the row's unique value
|
|
//get the row's unique value
|
|
|
var unique = elem.closest('tr').data('unique');
|
|
var unique = elem.closest('tr').data('unique');
|
|
|
- if (priv.options.debug) console.log('row({0}) {1}'.f(unique, elem.is(':checked') ? 'checked' : 'unchecked'));
|
|
|
|
|
|
|
+ if (priv.options.debug) console.log(p5Utils__format('row({0}) {1}', [unique, elem.is(':checked') ? 'checked' : 'unchecked']));
|
|
|
|
|
|
|
|
//store the row in checked array
|
|
//store the row in checked array
|
|
|
if (elem.is(':checked')) _uniqueCols[unique] = priv.getRow(unique);
|
|
if (elem.is(':checked')) _uniqueCols[unique] = priv.getRow(unique);
|
|
@@ -3517,14 +3486,6 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
if (tblAjax) tblAjax.refresh();
|
|
if (tblAjax) tblAjax.refresh();
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
- String.prototype.format = String.prototype.f = function() {
|
|
|
|
|
- var s = this;
|
|
|
|
|
- i = arguments.length;
|
|
|
|
|
- while (i--) s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]);
|
|
|
|
|
- return s;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
})(jQuery);
|
|
})(jQuery);
|
|
|
</script>
|
|
</script>
|
|
|
<?php
|
|
<?php
|
|
@@ -3803,7 +3764,7 @@ jQuery(document).ready(function(){
|
|
|
},
|
|
},
|
|
|
error: function(err) {
|
|
error: function(err) {
|
|
|
taskCnt.removeClass('AjaxTable-loading');
|
|
taskCnt.removeClass('AjaxTable-loading');
|
|
|
- //console.log('request error: {0}'.f(err));
|
|
|
|
|
|
|
+ //console.log(p5Utils__format('request error: {0}', [err]));
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -3901,7 +3862,7 @@ jQuery(document).ready(function(){
|
|
|
},
|
|
},
|
|
|
error: function(err) {
|
|
error: function(err) {
|
|
|
taskCnt.removeClass('AjaxTable-loading');
|
|
taskCnt.removeClass('AjaxTable-loading');
|
|
|
- //console.log('request error: {0}'.f(err));
|
|
|
|
|
|
|
+ //console.log(p5Utils__format('request error: {0}', [err]));
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
//return false;
|
|
//return false;
|