dbf_usr Posted December 21, 2021 Share Posted December 21, 2021 Включил конфигуратор. Добавил поля. Вовремя выполнения использую конфигуратор. После того как получил нужную форму таблицы хочу сохранить ее конфигурацию. Красны отметил то. что хочу сохранить. Вот тут пробую считать добавленные поля в LeftAxis а там - ПУСТО! col:=UniDBPivotGrid1.LeftAxis.Count-1; UniMemo2.Lines.Add(inttostr(col)); while col<>-1 do begin UniMemo2.Lines.Add(UniDBPivotGrid1.LeftAxis.Items[col].FieldName); col:=col-1; end; Подскажите пожалуйста откуда считывать информацию о полях добавленных в Row Label, Column Label, Values? Всем за ранее благодарен! Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted December 25, 2021 Author Share Posted December 25, 2021 UP! Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted December 25, 2021 Share Posted December 25, 2021 On 12/21/2021 at 4:49 AM, dbf_usr said: Включил конфигуратор. Добавил поля. Вовремя выполнения использую конфигуратор. После того как получил нужную форму таблицы хочу сохранить ее конфигурацию. Красны отметил то. что хочу сохранить. Вот тут пробую считать добавленные поля в LeftAxis а там - ПУСТО! col:=UniDBPivotGrid1.LeftAxis.Count-1; UniMemo2.Lines.Add(inttostr(col)); while col<>-1 do begin UniMemo2.Lines.Add(UniDBPivotGrid1.LeftAxis.Items[col].FieldName); col:=col-1; end; Подскажите пожалуйста откуда считывать информацию о полях добавленных в Row Label, Column Label, Values? Всем за ранее благодарен! Hello Please try below solution procedure TMainForm.uniDBPivotGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin //Sample Response // Aparams['leftAxis'].asstring , Aparams['aggregate'].asstring, Aparams['topAxis'].asstring //leftAxis=SaleMonth //aggregate=ItemsTotal //topAxis=Customer,ShipVIA end; procedure TMainForm.UniFormCreate(Sender: TObject); begin with uniDBPivotGrid1, JSInterface do begin JSAddListener('configchange', JSFunction('m,c',' ajaxRequest('+JSName+', "configchange", '+ ' {leftAxis: Array.prototype.map.call(c.leftAxis, function(item) { return item.header; }).join(","), '+ ' aggregate: Array.prototype.map.call(c.aggregate, function(item) { return item.header; }).join(","), '+ ' topAxis: Array.prototype.map.call(c.topAxis, function(item) { return item.header; }).join(",")})')) end; end; Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted December 28, 2021 Author Share Posted December 28, 2021 On 12/25/2021 at 6:02 PM, Hayri ASLAN said: Hello Please try below solution procedure TMainForm.uniDBPivotGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin //Sample Response // Aparams['leftAxis'].asstring , Aparams['aggregate'].asstring, Aparams['topAxis'].asstring //leftAxis=SaleMonth //aggregate=ItemsTotal //topAxis=Customer,ShipVIA end; procedure TMainForm.UniFormCreate(Sender: TObject); begin with uniDBPivotGrid1, JSInterface do begin JSAddListener('configchange', JSFunction('m,c',' ajaxRequest('+JSName+', "configchange", '+ ' {leftAxis: Array.prototype.map.call(c.leftAxis, function(item) { return item.header; }).join(","), '+ ' aggregate: Array.prototype.map.call(c.aggregate, function(item) { return item.header; }).join(","), '+ ' topAxis: Array.prototype.map.call(c.topAxis, function(item) { return item.header; }).join(",")})')) end; end; I added to the project. Nothing happened. Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted December 29, 2021 Share Posted December 29, 2021 16 hours ago, dbf_usr said: I added to the project. Nothing happened. Please attach the test case. It works for me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.