[2.2]Problems with combobox

  • Hi all,

    I have been developing an app using Ext2.1 , but when converting to 2.2 i've found that my combobox's give errors: "ls.push is not a function" , and the drop down list does not open.

    Converting back to Ext2.1 fixes the problem. Is there something that has changed between 2.1 and 2.2 that would cause this?

    My code:

    serviceStore = new Ext.data.Store({

    proxy: new Ext.data.ScriptTagProxy({
    url: ppOnline.base.getServiceURL()
    }),

    reader: new Ext.data.JsonReader({
    root: 'results',
    totalProperty: 'total',
    id: 'placeStore',
    fields: ['service']
    }),
    remoteSort: false
    });

    serviceStore.baseParams.class = 'Waybill';
    serviceStore.baseParams.method = 'getServices';
    serviceStore.baseParams.token_id = ppOnline.base.getToken();
    serviceStore.load();

    this.serviceFilterCombo = new Ext.form.ComboBox({
    store: serviceStore,
    id: 'serviceFilter',
    fieldLabel: 'Service',
    displayField: 'service',
    forceSelection: true,
    mode: 'local',
    selectOnFocus: true,
    triggerAction: 'all',
    typeAhead: true,
    width: 83
    });

    this.viewFilter = new Ext.Panel({
    hideBorders: true,
    frame: true,
    layout: 'form',
    labelWidth: 79,
    labelAlign: 'left',
    width: 200,
    height: 220,
    id: 'viewFilter',
    items: [this.serviceFilterCombo, this.invoiceFilter, this.orighubFilter, this.desthubFilter, this.accountFilter, this.referenceFilter, this.waybillFilter, this.updateButton]
    });

    I've tried changing the mode to "remote", also tried populating the combo manually (removing the store and adding items individually) with the same result. Any idea's?

    Thanks in advance


  • Me too! Was including another JSON class in my php backend.

    Thanks for the help!


  • Hmmm... I can get a simple example to work. Putting the combobox in a seperate form and then pre-loading the data as above works just fine. The only difference is: in my main application the combobox resides inside a panel with a bunch of other controls, and in the simple example its just on a formPanel by itself.

    Anyway, i guess this is not an Ext problem, just a problem with my code, back to debugging.

    If i find anything useful i will post it here.


  • Yes, that worked! I was including another json.js library too that
    I had forgotten about. Curiously it worked with Ext.2.1.

    No wonder I could not reproduce it outside my main application,
    because I didn't include the json library there.

    Thank you!

    rmitchel


  • I was having the ls.push error not just for combos, in my case 'ename' pointed to a utility function that I added to the object prototype :

    if(Object.prototype.asClone === undefined){
    Object.prototype.asClone = function(){
    // code block
    }
    }


    I took that out and all the errors were handled. I had to find another signature for the 'clone' function. thanks for the hint.


  • I had the same combo box problem. When I deleted the reference to json.js it works ....
    Will that be fixed sometime ?
    Cheers
    Karsten


  • I know that its not the store or the data since i can display all data in the store with:

    serviceStore.on('load', showServices);

    function showServices()
    {
    for (var i = 0; i < serviceStore.getCount(); i++)
    {
    var record = serviceStore.getAt(i);
    console.log(record.get(['service']));
    }
    }

    Seems like its something to do with the Ext.DataView, somehow its not rendering. Or perhaps a scoping issue? As i said this code works perfectly with Ext2.1, but 2.2 seems to work a lot better, much faster loading times etc so i really would like to use it. Anyone know how i could change my code to work with 2.2?


  • If you're using the approach I described above, you'll need to also patch the filter defined in line 1190 of ext-all-debug.js (the property is called filterOptRe).

    Daniel


  • Maybe we would have more luck at getting this looked into if it is posted in the bugs forum.
    I am trying to write up some example code that reproduces the error. I will post it when I'm done.

    I haven't been able to find any information on this bug either, though I suspect
    it is because the release is still fairly new.


  • Interesting. Should we post this in the "bugs" forum then? I can't find any posts relating to this elsewhere though, I wonder if anyone besides us is having the same problem.


  • Also i get this error after the first initial error that i mentioned in my first post.

    this.view is undefined
    select()(0, true)ext-all-debug.js (line 27812)
    onLoad()()ext-all-debug.js (line 27660)
    doQuery()("", true)ext-all-debug.js (line 27902)
    onTriggerClick()()ext-all-debug.js (line 27956)
    h()()ext-all-debug.js (line 1694)
    getViewWidth()()ext-base.js (line 10)
    [Break on this error] this.view.select(index);


  • You guys are not alone in this boat of 'ls.push' and similar errors with 2.2, I've am having a steady dose of them with some of my UX and initially thought they were localized to the UX's.
    I have reported them here (http://www.extjs.com/forum/showthread.php?t=44049)


  • I am having the same issue with the 'ls.push is not a function' errors under Ext2.2.
    Same code works under Ext2.1

    I don't think it is related to combobox though. I think it is something to do with
    the new Event Management code that went into Ext2.2.

    Upon reading your posts, I
    tried to comment out all my combobox code, but I still got the errors.

    If it helps debug the issue, the error happens whenever I open a modal popup window containing a form which includes a single combo box, a text field and an html editor.
    And two buttons (submit and cancel ). When I start to mouseover the form, I get a stream of errors in Firebug 'ls.push is not a function'.

    I attempted to put a breakpoint in ext-all-debug.js on line 1524 and it showed me that 'ls', object was null, though I don't know enough about Ext to know what this means. I also compared ext-all-debug.js from Ext2.2 with the one from Ext2.1, and the code which is causing the problem is new ( around line 1524 ), it didn't exist in Ext2.1. So looks like it is not a coding problem but an Ext problem.


  • I had a similar problem but with the extend function which gets introduced by the prototype framework (http://prototypejs.org). Since I had to keep the prototype.js functionality, I ended up making the following modification (which can be made for every function):

    File: ext-all-debug.js
    Version: 2.2
    Line: 1710
    Change: Add "extend" to the regular expression stored in the variable propRe

    I hope this helps.

    Daniel


  • I was also having this ls.push not found, but I've been able to figure out why.

    This is what I did to trace this:

    1) Turn on firebug with the Break on all errors debugger option turned on.
    2) Once the code stopped on line 1524, I hovered over the ename and saw that it was trying to reference toJSONString
    3) This was causing ls to become a function() instead of staying as an array. Hence, the reason there is no push method.
    4) I realized I had another json library on my page: http://www.JSON.org/js.html
    5) In this json library, there is also a toJSONString.

    So I removed the json library (Which I don't need because there are utils already in ExtJS), and I no longer had the ls.push not found.

    I hope this helps!




    Kenton







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about [2.2]Problems with combobox , Please add it free.