Jump to content

Desktop Grid PagingBar CheckBox: Read Event Click


andyhill

Recommended Posts

Grid Setup

...

      '    {'#13#10 +
      '      xtype: '#39'tbseparator'#39#13#10 +
      '    },'#13#10 +
      '    {'#13#10 +
      '      xtype: '#39'checkbox'#39','#13#10 +
      '      width: 24,'#13#10 +
      '      height: 24,'#13#10 +
      //   NEED LEFT and TOP Padding Here
      '      tooltip: '#39'Filter: InAction'#39','#13#10 +
      '      handler: function() '#13#10 +
      '      {'#13#10 +
      '        ajaxRequest(sender, '#39'_InAct_'#39', []); '#13#10 +
      '      }  '#13#10 +
      '    },'#13#10 +
      '    {'#13#10 +
      '      xtype: '#39'tbseparator'#39#13#10 +
      '    }'#13#10 +
...

  //////////////////////////////////////////////////////////////////////////////
  if EventName = '_InAct_' then begin // Fires But TUniCheckBox(Sender).Checked State is UnStable Here
    UniSession.AddJS('ajaxRequest(fMain.dbGrid, ''_InActChk_'', ["Obj="+Sender]);'); // Send CheckBox Object Here via Ajax to read state after stabilized - HOW
  end;

  //////////////////////////////////////////////////////////////////////////////
  if EventName = '_InActChk_' then begin // NEVER FIRES
    if TUniCheckBox(Params.Values['Obj']).Checked = True then begin // Read CheckBox Object State Here - HOW
      s:= 'checked';
    end else begin
      s:= 'un-checked';
    end;
  end;
 

Link to comment
Share on other sites

I have the CheckBox in the Grid PagingBar, I have the Listener firing Ajax events showing current state of CheckBox - ALL GOOD.

Can you please show me in code how to :-

Add Padding to CheckBox (Position it equally between the Seperators)

Add ToolTip to the CheckBox (Add flyout hint)

Based on my script code below

'pagingBar.afterCreate=function pagingBar.afterCreate(sender)'#13#10 +
      '{'#13#10 +

      '  sender.add('#13#10 +
      '  [ '#13#10 +

      '    {'#13#10 +
      '      xtype: '#39'tbseparator'#39#13#10 +
      '    },'#13#10 +
      '    {'#13#10 +
      '      xtype: '#39'checkbox'#39','#13#10 +
      '      width: 24,'#13#10 +
      '      height: 24,'#13#10 +
      //'      padding: 5px,'#13#10 +                                   
// FAILS JAVASCRIPT
      //'      tooltip: '#39'Filter: InAction'#39','#13#10 + // DOES NOTHING

      '      listeners: '#13#10 +
      '      { '#13#10 +


      '        render: function(c) '#13#10 +
      '        { '#13#10 +
      '          Ext.QuickTips.register('#13#10 +
      '          { '#13#10 +
      '            target: c, '#13#10 +
      '            text: ''Filter: InAction'' '#13#10 +                  
// DOES NOTHING
      '          }); '#13#10 +
      '        }, '#13#10 +

      '        change: function(el, v) '#13#10 +
      '        { '#13#10 +
      '          ajaxRequest(sender, "_InAct_", ["val="+v]) '#13#10 +
// WORKS
      '        } '#13#10 +
 

 

Link to comment
Share on other sites

UPDATE

(1) I have managed to get Checkbox Tips working after a lot of experimentation

(2) I have sort of got Padding working although it appears that it is only half implemented by Sencha

      '    {'#13#10 +
      '      xtype: '#39'checkbox'#39','#13#10 +
      '      id: ''ckOne'','#13#10 +
      '      width: 24,'#13#10 +
      '      height: 24,'#13#10 +
      '      tip: '#39'InAction'#39','#13#10 +
      '      style: ''margin: 2px; padding: 2px 2px 2px 2px;'','#13#10 + // Top, Right, Bottom, Left
      '      listeners: '#13#10 +
      '      { '#13#10 +
      '        render: function(c) '#13#10 +
      '        { '#13#10 +
      '          Ext.create(''Ext.tip.ToolTip'', '#13#10 +
      '            { '#13#10 +
      '              target: c.getEl(), '#13#10 +
      '              html: c.tip '#13#10 +
      '            } '#13#10 +
      '          ); '#13#10 +
      '        }, '#13#10 +
      '        change: function(el, v) '#13#10 +
      '        { '#13#10 +
      '          ajaxRequest(sender, "_InAction_", ["val="+v]) '#13#10 +
      '        } '#13#10 +
      '      }  '#13#10 +
      '    },'#13#10 +

style: renders the margin but not the padding, however if padding is omitted then margin is ignored !

(3) How do I set the ckOne.checked:= True/False; in JSCall ?

    dbGridFriends.JSInterface.JSCall('pagingBar.getComponent("ckOne").Checked = False', []);

FAILS, Please advise ASAP - Thanks

Link to comment
Share on other sites

2 hours ago, andyhill said:

3) How do I set the ckOne.checked:= True/False; in JSCall ?


    dbGridFriends.JSInterface.JSCall('pagingBar.getComponent("ckOne").Checked = False', []);

FAILS, Please advise ASAP - Thanks

I have not tested your code, but there are some recommendations here:

1. You are using JSCall incorrectly.

2. Try this:

dbGridFriends.JSInterface.JSCall('pagingBar.getComponent("ckOne").setValue', [False]);

 

Link to comment
Share on other sites

NoStyle (see below)

WithStyle (see below), as mentioned before the Style is only partially working for me (I want the CheckBox centered horizontally as well), please advise how.

'      style: ''margin: 2px; padding: 2px 2px 2px 2px;'','#13#10 +

 

NoStyle.jpg

WithStyle.jpg

Link to comment
Share on other sites

13 minutes ago, andyhill said:

NoStyle (see below)

WithStyle (see below), as mentioned before the Style is only partially working for me (I want the CheckBox centered horizontally as well), please advise how.

Please make a simple testcase for reproduce.

This is what it looks like for me, And it seems to me that they are centered...

pbar.png.81adc0b995cc9a4817c617a931f7dd20.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...