Jump to content
uniGUI Discussion Forums

ganzqgy

Members
  • Content Count

    132
  • Joined

  • Last visited

  • Days Won

    3

ganzqgy last won the day on September 13 2015

ganzqgy had the most liked content!

Community Reputation

4 Neutral

About ganzqgy

  • Rank
    Active Member

Profile Information

  • Gender
    Not Telling
  1. ganzqgy

    Calling a server side function from HTMLFrame

    1. UniSession.AddJS('$.ajax({' + 'url: "' + UniSession.CallbackUrl('$.ajax', self, []) + '",' + 'type: "POST",' + 'data: {username:"g", abc:123},' + 'dataType: "text",' + 'success: function(data){' + ' alert("OK!"+data);' + ' }' + '});'); procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;Params: TStrings); begin if EventName = '$.ajax' then begin UniEdit1.Text := 'AAAAAAA'; //Execution is not successful(Show no change)。 showmessage(UniEdit1.Text);(Display results correctly) This is why? UniSession.AResponse.ContentText := '{"success":true,"manager":[{"name":"xxx","userId":"222"},{"name":"yyy","userId":"333"}]}'; end; end; 2. unisession.AddJS('ajaxRequest(MainForm.window,"ajaxRequest",[]);'); procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;Params: TStrings); begin if EventName = 'ajaxRequest' then begin UniEdit1.Text := 'AAAAAA'; //Execution is successful(Show change) UniSession.Response := 'Ext.Msg.alert("","ok!");'; end; end;
  2. ganzqgy

    Checkbox in a list / NO DB

    Good! Thank you.
  3. ganzqgy

    Checkbox in a list / NO DB

    function beforerender(sender, eOpts) { document.doEvt = function(el) {console.log(el.id);}; sender.boundList.tpl.html =' <ul class="x-list-plain"> <tpl for="."> <li role="option" unselectable="on" class="x-boundlist-item"> <input id={[Ext.id()]} type="checkbox" onclick="doEvt(this)"/> {#}.{val} </li> </tpl> </ul> ' } Dynamically add or delete, serial number is not normal。 UniListBox1.Items.Add('fdsa'); UniListBox1.Items.Delete(UniListBox1.ItemIndex ); Why?
  4. function reconfigure(sender, store, columns, oldStore, the, eOpts) { sender.headerCt.insert(0,new Ext.grid.RowNumberer({text:'',width:'auto',align:'center',menuDisabled:false})); }
  5. ganzqgy

    Dataset onSetText event

    procedure Ttyhgl.UniDBEdit1Change(Sender: TObject); begin CDS1.FieldByName('user').AsString :=EncodeString(UniDBEdit1.Text); end; ok!!!
  6. ganzqgy

    Dataset onSetText event

    procedure Ttyhgl.CDS1userGetText(Sender: TField; var Text: string;DisplayText: Boolean); begin text:=DecodeString(sender.AsString ); end; procedure Ttyhgl.CDS1userSetText(Sender: TField; const Text: string); begin sender.AsString :=EncodeString(Text); //not work end;
  7. ganzqgy

    Dataset onSetText event

    Still did not solve the problem。
  8. ganzqgy

    Progress Bar Pager Extension

    This is not good, should be modified in the original place(pagingBar).
  9. Align don't use "bottom"! Anthors USE:left+right+bottom.
  10. ganzqgy

    PageSize Extension for UniDBGrid

    Don't use "added" event. USE: function pagingBar.beforeInit(sender, config) { sender.displayInfo= true; var pbp=Ext.create("Ext.ux.ProgressBarPager", {width:200}); var ptr=Ext.create("Ext.ux.PagingToolbarResizer",{displayText:"  每页行数:",options:[1,5,10,15,20,25,50,100,2000]}); sender.plugins=[pbp,ptr]; }
  11. in all extjs4.2, work! good! Self.ClientEvents.UniEvents.add('pagingBar.beforeInit=function(sender, config){' +'sender.displayInfo= true;' +'var pbp=Ext.create("Ext.ux.ProgressBarPager", {width:200});' +'var ptr=Ext.create("Ext.ux.PagingToolbarResizer",{displayText:"  分页行数:",options:[1,5,10,15,20,25,50,100,2000]});' +'sender.plugins=[pbp,ptr]' + '}'); but: sender.plugins=[Ext.create("Ext.ux.ProgressBarPager", {width:200}),ptr];--------------------------not work!
  12. procedure TBMUniDBGrid.LoadCompleted; var Obj : TExtFunction; objCols : TExtFunction; i : integer ; Cols : string ; begin if FactionColumnEvent = '' then FactionColumnEvent := 'ColsActionEvent' ; if FCheckBoxSelect then begin self.Options := self.Options + [dgRowSelect]; self.Options := self.Options + [dgMultiSelect]; end else begin self.Options := self.Options - [dgRowSelect]; self.Options := self.Options - [dgMultiSelect]; end; if FActionButtons.Count > 0 then begin Cols :=' eColumn = new Ext.grid.column.Action( {'+ 'xtype : ''actioncolumn'','+ 'width : ' + inttostr(FactionColumnWidth) + ', sortable : false , menuDisabled : true ,'+ 'items : [' ; for i := 0 to FActionButtons.Count - 1 do begin Cols := Cols + ' { icon: ' + quotedstr( StringReplace(FActionButtons.Items.FIconFilename,'\','/',[RfReplaceAll])) + ',' + 'tooltip: ' + quotedstr(FActionButtons.Items.ToolTip) + ',' + 'handler: function (grid , rowIndex, colIndex) {'+ 'grid.getSelectionModel().select(rowIndex);'+ 'ajaxRequest(' + self.jsname +',' + quotedstr(FActionColumnEvent) + ',["Buttons=" + "' +FActionButtons.Items.ButtonName+ '"]);'+ '}},'; end; if FActionColumnPos = Last then Cols := copy(Cols,1,length(Cols) - 1) + ' ]} ); columns.push(eColumn) ;' else Cols := copy(Cols,1,length(Cols) - 1) + ' ]} ); columns.unshift(eColumn) ;' ; objCols := JsFunction('sender, store, columns, oldStore, the, eOpts', Cols) ; Self.jsgridpanel.on('beforereconfigure',Objcols); Objcols.free(); end; Self.ClientEvents.UniEvents.add('pagingBar.beforeInit=function(sender, config){' +'sender.displayInfo= true;' +'var pbp=Ext.create("Ext.ux.ProgressBarPager", {width:200});' +'var ptr=Ext.create("Ext.ux.PagingToolbarResizer",{displayText:"  分页行数:",options:[1,5,10,15,20,25,50,100,2000]});' +'sender.plugins=[pbp,ptr]' + '}'); Obj := JSFunction('sender, selected, eOpts', 'var ArrayOfIndex = []; for (var i in selected){ArrayOfIndex.push(selected.index);}' + ' ajaxRequest(sender, "selectionchange", ["ArrayOfIndex="+Ext.encode(ArrayOfIndex)]);') ; Self.jsgridpanel.on('selectionchange',Obj); Obj.Free(); inherited; end; JSObjects.JSClasses['pagingBar'] := 'Ext.toolbar.Paging'; Paging control,No paging can not use
×