Author Topic: Occurrence of an event is unjust by a browser.  (Read 2725 times)

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Occurrence of an event is unjust by a browser.
« 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>
======================================================


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Occurrence of an event is unjust by a browser.
« Reply #1 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

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Occurrence of an event is unjust by a browser.
« Reply #2 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.
« Last Edit: June 29, 2017, 05:41:10 am by eloan »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Occurrence of an event is unjust by a browser.
« Reply #3 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

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Occurrence of an event is unjust by a browser.
« Reply #4 on: July 05, 2017, 02:26:28 pm »
It could be settled.
Thanks.