USEGEAR

导航

学习unigui【22】unistringGrid的标题栏双击事件

第一步:在TuniStringGrid的ClientEvents.ExtEvents中定义Ext.grid.Panel的reconfigure事件:

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    columns.forEach(function(col) {
        if (col.titleEl) {
            col.titleEl.on('dblclick', function() {
                ajaxRequest(sender, 'headerdblclick', ['colIndx=' + col.dataIndex]);
            })
        } else if (col.columns) {
            col.columns.forEach(function(col) {

                if (col.titleEl) {
                    col.titleEl.on('dblclick', function() {
                        ajaxRequest(sender, 'headerdblclick', ['colIndx=' + col.dataIndex]);
                    })
                }
            })

        }
    });
}

第二步:在TuniStringGrid定义OnAjaxEvent:

procedure TUniFrmBase_Edit_summary.unstrngrd_summaryAjaxEvent(
  Sender: TComponent; EventName: string; Params: TUniStrings);
begin
  inherited;

  if EventName = 'headerdblclick' then
    begin
      var mycol : Integer;
      mycol := Params.Values['colIndx'].ToInteger;
end; end;

params参数:

 

posted on 2024-03-01 17:14  USEGEAR  阅读(69)  评论(0编辑  收藏  举报