ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: eloan on June 28, 2017, 11:44:29 am

Title: Occurrence of an event is unjust by a browser.
Post by: eloan on June 28, 2017, 11:44:29 am
Hi.

please, help me.

I used select tag in cell value.
I want to use onchange event.
When it's used in grid, there is a case different from usual.

An assumed browser is IE11, chrome and Firefox.

The chrome, as expected.

The IE11  is 1st time only. When a focus is removed once, it becomes effective once again.
The Firefox is indicated list in twice, and a event is only the 2nd.

About Firefox.
It was no problem in version 38.0.1.
It's version 54 that a problem has occurred.

I using ParamQuery Pro v3.3.4.


=== test source ===
<select onchange="chTableVal(this);"><option></option><option>1</option><option>2</option></select>
<div id="testGrid" style="margin: auto;"></div>

<script>
function chTableVal(obj) {
   alert("test");
}
$(function () {
   var data = [ { select: '<select onchange="chTableVal(this);"><option></option><option>1</option><option>2</option></select>' }, ];
   var obj = {   title: "test",       
            dataModel: { data: data }
            };
   $("#testGrid").pqGrid(obj);
});
</script>
======================================================

Title: Re: Occurrence of an event is unjust by a browser.
Post by: paramvir on June 28, 2017, 11:28:59 pm
Select lists are not tested / supported this way.

Please use select list as editor instead of including html of select list directly in data.

as ShipVia column in https://paramquery.com/pro/demos/editing_custom
Title: Re: Occurrence of an event is unjust by a browser.
Post by: eloan on June 29, 2017, 05:33:53 am
Thanks.

A select list in editor was considered.
But it's difficult to find out that it's a list seemingly.
Is there a way to show that it's a list like ▼ on the right side?

Best regards.
Title: Re: Occurrence of an event is unjust by a browser.
Post by: paramvir on June 29, 2017, 12:36:30 pm
it's easy to place a bootstrap, jQueryUI or a custom icon at the right side of cell in postRender callback.

Code: [Select]
postRender: function(ui){
this.getCell(ui)
.css("position","relative")
.append("<span style='opacity:0.3;position:absolute;right:5px;top:5px;' class='glyphicon glyphicon-triangle-bottom'></span>");
},

In css:
Code: [Select]
.pq-grid .glyphicon{
font-family:Glyphicons Halflings;
}

In grid options:
Code: [Select]
    postRenderInterval: 0
Title: Re: Occurrence of an event is unjust by a browser.
Post by: eloan on July 05, 2017, 02:26:28 pm
It could be settled.
Thanks.