Hi,
Q1, I have a problem on ajax events that I can't find any source to resolve the problem.
I use DevExtreme grid/pivotGrid (for column filter checkbox with data...) in uniHTMLFrame, with ajaxRequest, I need to load data in JSON format.
I can see the XHR data is sent to browser correctly from chromeDeveloperTools, however when I look at result from console, i see only result = "true" and no data displayed in grid.
if I use JSON String directly, no problem...
I tried many way to handle the respone but i couldn't handle...
Q2, if I use uniHTMLFrame in a Modal Form, devexpress filter column popup appears on mainForm, popup goes out from htmlFrame,
I couldn't find any solution without putting uniHTMLFrame in to main form.
What am I doing wrong, thanks.
<div class="demo-container">
<div id="gridContainer"></div>
</div>
<script>
$(function(){
var GetCustomers = function(e) {
var deferred = $.Deferred();
result=ajaxRequest(MainForm.UniHTMLFrame1,e,[]);
<!-- result=[{"ID":1,"CompanyName":"Premier Buy"}] THIS IS OK-->
console.log(result);
deferred.resolve(result);
return deferred.promise();
}
$("#gridContainer").dxDataGrid({
dataSource: GetCustomers('load'),
columns: ["ID","CompanyName"]
}).dxDataGrid("instance");
});
</script>
procedure TMainForm.UniHTMLFrame1AjaxEvent(Sender: TComponent;
EventName: string; Params: TUniStrings);
var s:string;
begin
if EventName = 'load' then
begin
s:='['+
'{"ID":1,"CompanyName":"Premier Buy"},'+
'{"ID":2,"CompanyName":"ElectrixMax"},'+
'{"ID":3,"CompanyName":"Video Emporium"}+
']';
//unisession.JSONDirect(s);
//unisession.Response := s;
unisession.SendResponse(s,true);
end;
end;
Platform:
Delphi Tokyo,
uniGui 1.0.0.1424 (licensed)