Jump to content

A Microsoft Excel grid plugin for Ext JS 4.


Recommended Posts

Hello everybody!

 

A Microsoft Excel grid plugin for Ext JS 4:

 

http://www.lukehorvat.com/blog/excel-grid-plugin-for-ext-js-4/

 

https://gist.github.com/lukehorvat/5607821/raw/6fe2113b4946b36e8bcdf10a3904560ef9a00758/excel-grid-plugin.js

 

 

How to use?
 
1. Download and paste the file in the directory ... \ files
 
2. UniServerModule> CustomFiles> files/excel-grid-plugin.js
 
3. UniDBGrid1> UniEvents> OnBeforeInit>
function OnBeforeInit (sender)
{
   sender.plugins = [{ptype: 'excelcellediting', clicksToEdit: 2}];
}
 
Best Regards
  • Upvote 3
Link to post
Share on other sites

thank you!your excel grid is what i want,I havd a small question,when i enter some

chars in the cell and press the 'enter' key ,the cursor just skip to the cell of the same

column of the next row,if i want the cursor skip to the cell of the next column of the

same row,how to do it?

Link to post
Share on other sites
Hi wxb_km!

 

In the script (excel-grid-plugin.js) find the lines 

 



sm.move (e.shiftKey? 'up' : 'down', e);


And replace the "up" on the "left", "down" on the "right",

 

ie 


sm.move (e.shiftKey? 'left' : 'right', e);

Best Regards
Link to post
Share on other sites

Hi!Duser:

 

After my using your Excel grid plugin,I found a problem.if your Excel grid plugin

 

 is used,when setting some columns's 'locked' property to true,the unidbgrid can't show.

maybe your Excel grid plugin is incompatible in some extent?

Is there a solution for this problem?

thank you.

 

 

 

Link to post
Share on other sites

Hi!Duser:

 

After my using your Excel grid plugin,I found a problem.if your Excel grid plugin

 

 is used,when setting some columns's 'locked' property to true,the unidbgrid can't show.

maybe your Excel grid plugin is incompatible in some extent?

Is there a solution for this problem?

thank you.

 

Hi wxb_km!
 
Unfortunately yes, Excel grid plugin is incompatible in some extent ...
 
I'll try to fix it ...
 
Sincerely ...
Link to post
Share on other sites
Hi Farshad!
 
When using this plugin, there is one nasty error, and one fatal error:
 
 
1. If the cell is active and click mouse to another row or to another column, there is an error row mismatch, if you go on the same row there is no error.

 

2. When using the locked property column is an error a.selModel is undefined.
 
Can you give a solution or explanation ...
 
If this functionality, the UniDBGrid would include by default, it would be great!!!

 

Thanks in advance.
Link to post
Share on other sites

What is a plus?

What is this plugin?

Can you explain briefly?

 

Hi Ulugbek.

 

    

briefly...

    

 

You've worked with excel sheet?

This plugin provides a similar feature!

 

Some of the advantages:

1. Can directly edit the cell without pressing enter.

2. After editing (when you press enter), go directly to the next cell.

 

If you are going to edit directly in the grid, these features make it easy to work!

 

This time, these features are not implemented in UniDBGrid.

 

Best regards!

Link to post
Share on other sites
  • 1 month later...
Hi Farshad!

 

I use this plugin.

 

If the cell is active and click mouse to another row or to another column, there is an error row mismatch, if you go on the same row there is no error.

 

Can You correct this plugin?

 

Thank you, Sincerely.
Link to post
Share on other sites
  • 2 weeks later...
  • 3 years later...

Hello DD,

 

Can this work with  UniStringGrid ?

 

I need the same behaviour :
>>1. Can directly edit the cell without pressing enter.
>>2. After editing (when you press enter), go directly to the next cell 

 

Thx

Link to post
Share on other sites

Hi,

 

I need the same behaviour :
>>1. Can directly edit the cell without pressing enter.

 

Can you try this solution for now ?!:

 

UniStringGrid1 -> ClientEvents -> ExtEvents -> function keydown:

function keydown(e, t, eOpts)
{
    var btn=e.button;
    if (btn == 36 || btn == 37 || btn == 38 || btn == 39) {
        return false;
    };
    
    var me=this.normalGrid;
    if (me && me.editingPlugin) {
        if (!me.editingPlugin.editing) {
            me.editingPlugin.startEditByPosition(me.getSelectionModel().getCurrentPosition());
            me.editingPlugin.getActiveEditor().field.selectText();        
        }
    }
}

A similar question: http://forums.unigui.com/index.php?/topic/7623-questions-about-unistringgrid/&do=findComment&comment=38965

 

Best regards,

Link to post
Share on other sites

Thank you DD,

 

If I do not abuse too much of your kindness, 

is it possible to jump to the Cell down (same Col and row +1)  not to the Right ?

 




function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
  for (var i = 0; i < columns.length; i++) {
  if (columns.getEditor()) {
  columns.getEditor().on('specialkey', function (field, e) {   
   if (e.getKey() == 13) {
     e.keyCode = e.TAB;           <----  Here    e.VK_DOWN   (40)  ????
     return e.keyCode;
    }
   })
  }    
 }
}

 

I looked at sencha JS to find something like   e.KeyCode = e.DOWN

but I did'nt find.

Link to post
Share on other sites

Hi,

 

If I do not abuse too much of your kindness, 

is it possible to jump to the Cell down (same Col and row +1)  not to the Right ?

 

OK, Np

 

Can you try this approach for now ?!:

 

UniStringGrid1 -> ClientEvents -> ExtEvents -> function reconfigure:

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    var grid = sender;
    for (var i = 0; i < columns.length; i++) {
        if (columns[i].getEditor()) {
            columns[i].getEditor().on('specialkey', function(field, e) {
                if (e.getKey() == 13) {
                    var store = grid.getStore();
                    var selModel = grid.getSelectionModel();
                    var selectedRecord = selModel.getLastSelected();
                    var recordIndex = store.indexOf(selectedRecord);
                    var nextRecord = store.getAt(recordIndex + 1);
                    if (nextRecord) {
                        selModel.select(nextRecord);
                    }
                }
            })
        }
    }
}

http://forums.unigui.com/index.php?/topic/6389-skip-to-the-next-line-in-a-unidbgrid/&do=findComment&comment=32630

 

Also you can try this approach too:

http://forums.unigui.com/index.php?/topic/6389-skip-to-the-next-line-in-a-unidbgrid/&do=findComment&comment=32772

 

Best regards,

  • Upvote 1
Link to post
Share on other sites
  • 3 months later...

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...