Results 1 to 6 of 6

Thread: Failed to load resource on using Sencha CMD

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    32
    Vote Rating
    0
      0  

    Default Failed to load resource on using Sencha CMD

    Hi !. I generate a project through Sencha CMD with Ext JS 4.2.1 GPL and, while pasting in my app.js, i get this errors in the JS console:

    [/COLOR]

    [COLOR=red !important][/COLOR]

    [/COLOR]
    The grid is rendered but it seems I can't use the drag and drop plugin... While if I paste the same code in the API page, it all works fine... I am sure that I am using the same api version... So I can't think of what is the problem here... Does anyone knows or has a clue ?... Thankx

    Code:
    Ext.require(['Ext.Button','Ext.data.*','Ext.window.MessageBox','Ext.grid.*']);        Ext.onReady(function () {
                
                Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name'],
        data: [["Lisa"], ["Bart"], ["Homer"], ["Marge"]],
        proxy: {
            type: 'memory',
            reader: 'array'
        }
    });
    
    
    var gridp = Ext.create('Ext.grid.Panel', {
        store: 'simpsonsStore',
        columns: [
            {header: 'Name',  dataIndex: 'name', flex: true}
        ],
        viewConfig: {
            plugins: {
                ptype: 'gridviewdragdrop',
                dragText: 'Drag and drop to reorganize'
            }
        },
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });
    
    
    gridp.getView().on('beforedrop', function(node, data, overModel, dropPosition, dropHandlers) {
        // Defer the handling
        dropHandlers.wait = true;
        Ext.MessageBox.confirm('Drop', 'Are you sure', function(btn){
            if (btn === 'yes') {
                dropHandlers.processDrop();
            } else {
                dropHandlers.cancelDrop();
            }
        });
    });
    });

  2. #2
    Sencha User
    Join Date
    Jul 2010
    Posts
    32
    Vote Rating
    0
      0  

    Default

    Hi !. I modified the code and put this...
    Ext.require(['*']);
    And all worked... I will then see which things I should include...

  3. #3
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Vote Rating
    247
      0  

    Default

    If you run your application in dev (using ext-dev.js) you should see synchronous load warnings in the console and that will tell you which classes you need to require (provided you have Ext.Loader enabled so the synchronous class loading is working with ext-dev.js).
    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our human resources manager: fabienne.bell@sencha.com

  4. #4
    Sencha User
    Join Date
    Jul 2010
    Posts
    32
    Vote Rating
    0
      0  

    Default

    Thankx you so much for answering slemmon !. I was trying to build with this example a custom proxy; I mean... That when I start my drag event and custom div follows the mouse pointer... I know that there is a property that needs to be returned within the getDragData object but I keep on getting a standard div and a standard icon... Do you have any clue about this ?...
    Thankx...

  5. #5
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Vote Rating
    247
      0  

    Default

    To clarify, you're having trouble with the drag proxy in general? Or you're just having trouble in a Cmd built app and not in the dev app?
    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our human resources manager: fabienne.bell@sencha.com

  6. #6
    Sencha User
    Join Date
    Jul 2010
    Posts
    32
    Vote Rating
    0
      0  

    Default

    Firstly it was a Sencha CMD problem... But I manage to see what was the problem (nothing to do)... After that, I wastrying to build a drag and drop example but I couldn't build a custom proxy... I realize that this section wasn't the correct one so I post in another place... Anyway... The custom div that follows the mouse pointer needs to be build in the getDragData method ?

    Thankx

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •