1
Help for ParamQuery Pro / Re: input attr type time question (time list 24-hour setting)
« on: February 28, 2024, 09:42:16 am »
Is there any way to change it other than system local?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
$(function () {
var books = [
{code:"1",codeNm:"ActionScript"},
{code:"2",codeNm:"Asp"},
{code:"3",codeNm:"BASIC"},
{code:"4",codeNm:"C"},
{code:"5",codeNm:"Clojure"},
{code:"6",codeNm:"COBOL"},
{code:"7",codeNm:"ColdFusion"},
{code:"8",codeNm:"Erlang"}
];
var colM = [
{
title: "Books",
dataIndx: "books",
width: 500,
cls: 'pq-drop-icon pq-side-icon',
editor: {
type: "select",
attr:'multiple',
options: books,
valueIndx:"code",
labelIndx:"codeNm",
init: function (ui) {
//convert ui.cellData data format from string to array
//and assign it to editor value.
console.log(ui.cellData);
ui.$editor.val((ui.cellData || "").split(","))
//convert native select list to pqSelect.
.pqSelect({
deselect: false,
checkbox: true
});
setTimeout(function () {
//open editor dropdown on first activation.
ui.$editor.pqSelect('open');
})
}
},
},
];
var dataModel = {
location: "remote",
dataType: "JSON",
method: "GET",
url: "/content/invoice.json",
getData: function (response) {
response.data.forEach(function (rd) {
//make ShipAddress multiline text.
rd.ShipAddress = rd.ShipAddress + "\n" + rd.ShipCity + "\n" + (rd.ShipRegion || "") + "\n" + rd.ShipPostalCode;
})
console.log(response[0]);
response.data[0].books = "1,2,3";
response.data[0].code = ["1","2","3"];
response.data[0].codeNm = ["ActionScript","Asp","BASIC"];
return response;
}
}
$("div#grid_custom_editing").pqGrid({
title: "Multi select editor",
dataModel: dataModel,
colModel: colM
});
});
header.cls = 'pq-drop-icon pq-side-icon';
header.editor.type = 'select';
header.editor.attr = 'multiple';
header.editor.mapIndices = {
[header.editor.labelIndx]: header.editor.labelIndx,
[header.editor.valueIndx]: header.editor.valueIndx,
};
header.editor.init = function (ui) {
ui.$cell
.find('select')
.pqSelect({
multiplePlaceholder: '선택하세요.',
checkbox: true, //adds checkbox to options
maxDisplay: 5,
})
.pqSelect('open');
};
Attachments to previous texts
header.editor.init = function (ui) {
ui.$cell
.find('select')
.pqSelect({
multiplePlaceholder: '선택하세요.',
checkbox: true, //adds checkbox to options
bootstrap: { on: true },
})
.on('change', function (evt) {
var val = $(this).val();
console.log(evt);
$('#selected_option1').text('Selected option: ' + val);
})
.pqSelect('open');
// setTimeout(function () {
// ui.$cell.find('select').pqSelect('open');
// });
};
header.editor.attr = 'type="datetime-local"';
header.editor.init = function (ui) {
var $inp = ui.$cell.find('input');
//initialize the editor
$inp.timepicker({
timeFormat: 'HH:mm',
interval: 10,
minTime: '10',
maxTime: '6:00pm',
defaultTime: '11',
startTime: '10:00',
dynamic: false,
dropdown: true,
scrollbar: true,
showTimepicker: function () {
console.log('show');
},
});
};
header.editor.init = function (ui) {
ui.$cell.find('select').pqSelect({
multiplePlaceholder: 'Select Countries',
checkbox: true, //adds checkbox to options
});
setTimeout(function () {
ui.$cell.find('select').pqSelect('open');
});
};
2) I did "checkbox: true" to make multiple selections in pqSelect, but only single selections. How do I fix this??
this.gridOptions.header = [ {
title: '작성자' /* 작성자 */,
dataIndx: 'createUserNm',
width: 120,
dataType: 'string',
},
{
title: '작성일' /* 작성일 */,
dataIndx: 'createDt',
width: 120,
dataType: 'string',
},
{
title: 'Order Date2',
width: '150',
dataIndx: 'updateDt',
dataType: 'date',
format: 'yy-mm-dd',
cls: 'pq-calendar pq-side-icon',
editor: {
type: 'textbox',
init: function (ui) {
var $inp = ui.$cell.find('input');
var grid = this;
var format = ui.column.format;
var vald = $inp.val();
var val = vald
? $.datepicker.formatDate(format, new Date(vald))
: '';
// initialize the editor
$inp
.attr('readonly', 'readonly')
.val(val)
.datepicker({
changeMonth: true,
changeYear: true,
dateFormat: format,
showAnim: '',
onSelect: function () {
this.firstOpen = true;
},
beforeShow: function (input, inst) {
setTimeout(function () {
$('.ui-datepicker').css('z-index', 999999999999);
});
},
onClose: function () {
this.focus();
},
});
},
},
validations: [
{
type: 'regexp',
value: '^[0-9]{2}/[0-9]{2}/[0-9]{4}$',
msg: '날짜형식에 맞게 입력하세요.',
},
],
},
];
editModel: {
clicksToEdit: 2,
},
2) Through the code above, I can do "clicksToEdit: 2" throughout the header, but can I set "clicksToEdit" separately for each header??
Thank you for your answer.
If I use 'pqSelect', it comes out as shown in the picture, what is wrong? And once I click on the grid, it goes into modification mode, but even if I click on a mouse somewhere other than the grid, I want to end modification mode.
{
title: '코드도메인',
dataIndx: 'codeDomainNm',
width: 150,
dataType: 'string',
cls: 'pq-drop-icon pq-side-icon',
editor: {
type: 'select',
valueIndx: 'codeDomainCd',
labelIndx: 'codeDomainNm',
mapIndices: {
codeDomainNm: 'codeDomainNm',
codeDomainCd: 'codeDomainCd',
},
init: function (ui) {
ui.$cell.find('select').pqSelect();
setTimeout(function () {
ui.$cell.find('select').pqSelect('open');
});
},
options: [],
},
}, // 코드도메인
I know how to get a radio box or a checkbox when I click using the 'editor' attribute. However, I used the 'render' attribute to code in html, and I made the radio box checkbox appear on the default screen, and if it's that value, it's checked. But when a change event like onchange occurs, can I change the value of that row??