ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: omerix on May 23, 2018, 12:54:45 pm
-
Hello,
I am using the following code for the custom field.
var HucreS = function (ui) {
var $cell = ui.$cell,
rowData = ui.rowData,
dataIndx = ui.dataIndx,
width = parseInt(ui.column.width) - 40,
cls = ui.cls;
var dc = $.trim(rowData[dataIndx]);
$cell.append("<input type='text' name='" + dataIndx + "' id='" + dataIndx + "' value='" + dc + "' class='" + cls + " fl ls' style='z-index: 40000;width:" + width + "px;'/>"
+"<span class='ui-widget-header fl ek' onclick=\"window.parent.Popui('../ModGenel/Liste.asp?js=6&l=s&e=FrameOrder',782,483,'');\"><i class='ui-icon ui-icon-search ck'></i></span>"
+"<span class='ui-widget-header fl ek' onclick=\"window.parent.Popui('../ModStok/Kart.asp?menu=h&KOD="+dc+"',1044,521,'Stok Kart');\"><i class='ui-icon ui-icon-plus ck'></i></span>"
);
//$cell.find("input").focus()
};
",{title: 'Mal.Kodu',dataIndx:'MKOD',width:75,dataType:'string',editable:true,hidden:false,editor:{type:HucreS}}"&VbNewLine&_
In version 5.1. I can not use the special buttons next to the input. When I click the buttons, it leaves the field.
Video: https://youtu.be/ji5cAZ8Ww7k?t=13s
Version 2.2.0. There is no problem.
Video: https://youtu.be/ji5cAZ8Ww7k?t=38s
-
Hello there,
"editModel: {onBlur: null}," when I clicked on the <span>.
But I could not write the values in the field on the line popup window.
How do I assign values to the columns in the row I click?
-
Could you please share a jsfiddle.
-
Hello,
https://jsfiddle.net/omerx/2mm5y2fw/2/
Click on the "search" button in column A to open popup. I want to write a value to that cell.
Popup Command Button: window.parent.frames[0].$('.pq-editor-focus').val('Test');
Can I set value the value by clicking on it in this way?;
<a href='#' Onclick="$grid('A','5').val('Test');">Set To Value A5 or 1/5</a>
Could you please share a jsfiddle.
-
Value can be written to editor by simply:
$('.pq-editor-focus').val('test')
https://jsfiddle.net/2mm5y2fw/3/
-
Hello Param,
Thanks for the answer
What can I do to write "Test2" to column "B" at the same time?
Also, the buttons move out of the column. I'm doing width-40, but is not that enough?
Is the "Custom Input Create" incorrect?
var HucreS = function(ui) {
var $cell = ui.$cell,
rowData = ui.rowData,
dataIndx = ui.dataIndx,
width = parseInt(ui.column.width) - 40,
cls = ui.cls;
var dc = $.trim(rowData[dataIndx]);
$cell.append("<input type='text' name='" + dataIndx + "' id='" + dataIndx + "' value='" + dc + "' class='" + cls + " fl ls' style='z-index: 40000;width:" + width + "px;'/>" +
"<span class='ui-widget-header fl ek' onclick=\"$('.pq-editor-focus').val('test')\"><i class='ui-icon ui-icon-search ck'></i></span>" +
"<span class='ui-widget-header fl ek' onclick=\"window.parent.Popui('../ModStok/Kart.asp?menu=h&KOD=" + dc + "',1044,521,'Stok Kart');\"><i class='ui-icon ui-icon-plus ck'></i></span>"
);
//$cell.find("input").focus()
};
-
What can I do to write "Test2" to column "B" at the same time?
Row information i.e. rowIndx can be obtained by getEditCell() and getCellIndices() methods.
https://paramquery.com/pro/api#method-getEditCell
https://paramquery.com/pro/api#method-getCellIndices
Test2 to column B can be written by
rowData[ dataIndx of column B ] = "Test2"
or by updateRow() API
https://paramquery.com/pro/api#method-updateRow
-
Hello param,
Could you give me a simple sample code?
What can I do to write "Test2" to column "B" at the same time?
Row information i.e. rowIndx can be obtained by getEditCell() and getCellIndices() methods.
https://paramquery.com/pro/api#method-getEditCell
https://paramquery.com/pro/api#method-getCellIndices
Test2 to column B can be written by
rowData[ dataIndx of column B ] = "Test2"
or by updateRow() API
https://paramquery.com/pro/api#method-updateRow
-
Please check this.
https://jsfiddle.net/2mm5y2fw/4/
$(document).on('click', ".ui-icon-search", function(){
debugger;
var obj = grid.getEditCell(),
$editor = obj.$editor;
$editor.val('test');
var obj2 = grid.getCellIndices(obj);
obj2.rowData[1] = "test2";
grid.refreshCell({rowIndx: obj2.rowIndx, dataIndx: 1})
})
-
Thank you.
Nice code. I also review the "updateRow api" you recommend.