Jump to content


Photo

dbgrid with ext 6.6


  • Please log in to reply
9 replies to this topic

#1 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 842 posts

Posted 26 January 2018 - 07:53 PM

Hi.

 

I'm testing new beta version with ext 6.5

 

I have 2 quiestions.

 

- This code don't work. I have it in mainform script:

Ext.override(Ext.view.Table, {
    walkCells: function (pos, direction, e, preventWrap, verifierFn, scope) {                   
      var grid = pos.view.headerCt.grid;   
      if ((direction == 'right' && grid.columnManager.columns[pos.column+1] ) ||
        (direction == 'left' && grid.columnManager.columns[pos.column-1] ) ||
        (direction == 'down' || direction == 'up'))
      {
        return this.callParent(arguments);
      } else {
        return false;
      }
    }            
});
 

 

- This, in custom css, only show horizontal lines:

 

.x-grid-with-row-lines .x-grid-td {
   border-color: black;
}

.x-grid-with-col-lines .x-grid-cell {
   border-color: black;
}
 

 

- And this has a extrange behaviour too:

 

   if (key = VK_NEXT) then
      (sender as tunidbgrid).datasource.Dataset.RecNo := (sender as tunidbgrid).datasource.Dataset.RecNo + (sender as tunidbgrid).WebOptions.PageSize;

   if (key = VK_PRIOR) then
      (sender as tunidbgrid).datasource.Dataset.RecNo := (sender as tunidbgrid).datasource.Dataset.RecNo - (sender as tunidbgrid).WebOptions.PageSize;

 

   if (Key = VK_DOWN)and((Sender as TUniDBGrid).WebOptions.Paged) then  begin
      if ((Sender as TUniDBGrid).DataSource.DataSet.RecNo mod (Sender as TUniDBGrid).WebOptions.PageSize) = 0 then
        (Sender as TUniDBGrid).DataSource.DataSet.Next
   end;

   if (Key = VK_UP)and((Sender as TUniDBGrid).WebOptions.Paged) then  begin
      if (((Sender as TUniDBGrid).DataSource.DataSet.RecNo - 1) mod (Sender as TUniDBGrid).WebOptions.PageSize) = 0 then
        (Sender as TUniDBGrid).DataSource.DataSet.Prior
   end;
 

 

 

Thanks.

 


  • 0

#2 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 842 posts

Posted 06 February 2018 - 05:44 PM

no comment?

Enviado desde mi SM-A500FU mediante Tapatalk
  • 0

#3 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4754 posts

Posted 06 February 2018 - 05:46 PM

Hi,

 

Can you make a simple testcase for this ?!

 

Best regards,


  • 0

#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4754 posts

Posted 06 February 2018 - 06:13 PM

- This code don't work. I have it in mainform script:

Ext.override(Ext.view.Table, {
    walkCells: function (pos, direction, e, preventWrap, verifierFn, scope) {                   
      var grid = pos.view.headerCt.grid;   
      if ((direction == 'right' && grid.columnManager.columns[pos.column+1] ) ||
        (direction == 'left' && grid.columnManager.columns[pos.column-1] ) ||
        (direction == 'down' || direction == 'up'))
      {
        return this.callParent(arguments);
      } else {
        return false;
      }
    }            
});

 

Can you try this ?: pos.column changed to pos.colIdx

Ext.override(Ext.view.Table, {
    walkCells: function(pos, direction, e, preventWrap, verifierFn, scope) {
        var grid = pos.view.headerCt.grid;
        if ((direction == 'right' && grid.columnManager.columns[pos.colIdx + 1]) ||
            (direction == 'left' && grid.columnManager.columns[pos.colIdx - 1]) ||
            (direction == 'down' || direction == 'up')) {
            return this.callParent(arguments);
        } else {
            return false;
        }
    }
});

  • 0

#5 Stefano Monterisi

Stefano Monterisi

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 143 posts

Posted 08 February 2018 - 11:43 AM

HI, Jahlxx,

what is your code for, exactly ?
(what kind of result you obtain in walking on grid? Keyboard use with arrow key?)

Thanks,

Stefano


  • 0

#6 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 842 posts

Posted 11 February 2018 - 08:39 PM

Hi.

 

Sorry for the delay.

 

DD: it seems that your code works.

 

Stefano: Ye. I need this for move in the grid with arrow keys. When the grid is paged, when I'm in the last row (record) of one page, when press down arrow go to the next page to it's first row. And when I am in the first row of one page, and press up arrow, go to the priog page, to it's last row.

 

Thanks.


  • 0

#7 picyka

picyka

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 90 posts

Posted 11 February 2018 - 11:05 PM

Which grid event is this code going to? the logic would be to get on the last line press the down arrow to jump to the next page it?

does it work in version 4.2?


  • 0

#8 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 842 posts

Posted 12 February 2018 - 09:45 AM

Yes, it works in 4.2

 

I try to clarify.

 

I have a grid, paged (25 records per page), and in keydown, this:

 

- AvPag: Go to next page

- RePag: Go to prior page

- KeyDown: Go to next record. If the record is the last in one page, go to the first record of the next page

- KeyUp: Go to prios record. If the record is the first in one page, go to the last record of the prior page

 

This works in 4.2 but don't work in 6.5

 

I hope this is more clear.

 

Thanks.


  • 0

#9 picyka

picyka

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 90 posts

Posted 12 February 2018 - 11:19 AM

I could not make it work .. can you create an example? I use version 4.2


  • 0

#10 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 842 posts

Posted 19 February 2018 - 01:17 PM

ok.

 

here is a test made with 6.5, and the same with 4.2.

 

the only diff. between them is the mainform script (as suggested by DD, in 6.5, changing pos.column to pos.colIdx).

 

you can see the difference, navigating with keys (arrow keys, start, end, avpag, repag), and the difference in showing the grid. is not showed as uniservermodule.customcss (only shows vertical lines).

 

thanks.

 

Attached Files


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users