Jump to content
uniGUI Discussion Forums
jahlxx

dbgrid with ext 6.6

Recommended Posts

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.

 

Share this post


Link to post
Share on other sites

no comment?

 

Enviado desde mi SM-A500FU mediante Tapatalk

Share this post


Link to post
Share on other sites

Hi,

 

Can you make a simple testcase for this ?!

 

Best regards,

Share this post


Link to post
Share on other sites

- 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;
        }
    }
});

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

 

test65.zip

test42.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×