Jump to content

ganzqgy

Members
  • Posts

    132
  • Joined

  • Last visited

  • Days Won

    4

ganzqgy last won the day on May 28 2022

ganzqgy had the most liked content!

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ganzqgy's Achievements

Active Member

Active Member (3/4)

5

Reputation

  1. 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. 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?
  3. function reconfigure(sender, store, columns, oldStore, the, eOpts) { sender.headerCt.insert(0,new Ext.grid.RowNumberer({text:'',width:'auto',align:'center',menuDisabled:false})); }
  4. procedure Ttyhgl.UniDBEdit1Change(Sender: TObject); begin CDS1.FieldByName('user').AsString :=EncodeString(UniDBEdit1.Text); end; ok!!!
  5. 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;
  6. Still did not solve the problem。
  7. This is not good, should be modified in the original place(pagingBar).
  8. Align don't use "bottom"! Anthors USE:left+right+bottom.
  9. 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]; }
  10. 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!
  11. 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
×
×
  • Create New...