This is a migrated thread and some comments may be shown as answers.

Two Combos, remote data, refuse to open

3 Answers 113 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
sitefinitysteve asked on 01 Dec 2011, 04:51 AM
So well I mean they DO open...for a fraction of a second, then the close animation kicks in.  Data is populated in the comobs after an autocomplete above.  It doesnt happen with every search I do, but most :/

Seen anything like this before (didn't happen in beta2)

var autoCompleteCombo = $("#food-box").kendoComboBox({
        autoBind: false,
        minLength: 3,
        filter: "contains",
        suggest: false,
        dataTextField: "Long_Desc", //JSON property name to use
        dataValueField: "NDB_No", //JSON property name to use
        dataSource: autoCompleteDS,
        change: function (e) {
            if (this._current) {
                var item = this.dataSource.view()[this._current.index()];
                currentItem = item; //store the selected item
 
                //Get the weight navproperty
                weightDS.transport.options.read.url = item.usda_WEIGHT.__deferred.uri;
                weightDS.fetch();
 
                fromCombo.enable();
                toCombo.enable();
 
                //fromCombo.open();
            }
        }
    }).data("kendoComboBox");
 
    //Hide the arrow om the combo
    autoCompleteCombo._arrow.hide()
        .closest(".k-dropdown-wrap")
        .addClass("combo-to-autocomplete");

And if I do something like this
fromCombo.enable();
                toCombo.enable();
 
                fromCombo.open();
                toCombo.open();

It looks like they expand about 30%, animate back up to 0, then the dropdown expands properly

3 Answers, 1 is accepted

Sort by
0
Tom
Top achievements
Rank 1
answered on 01 Dec 2011, 06:39 AM
I'm seeing the same behaviour. In my case I'm loading data through a traditional ajax call, loading a dataSource with this, then using that to populate a DropDownList. But what I see if exactly what you see. Interesting the list box renders without the dropdown arrow, but when I click where it should be I momentarily see the list, then it closes up again. Oh, and by the way, I'm at Beta2.

-- EDIT: Just downloaded production version, no change

My code:
function LoadAccountList() {
    $.ajax({
        type: "POST",
        url: "../cccs/service.svc/AccountList",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        processdata: false,
        success: function (msg) {
            accountListDataSource = new kendo.data.DataSource({ data: msg.AccountListResult.AccountList });
            $("#accountBox").kendoDropDownList({
                dataTextField: "FavouriteName",
                dataValueField: "LedgerCodeId",
                dataSource: accountListDataSource
            });
        }
    });
}
0
Georgi Krustev
Telerik team
answered on 02 Dec 2011, 04:32 PM
Hi,

#Steve
The described behavior is expected. When call fromCombo.open() method, the widget focuses the input and opens the popup. When call toCombo.open(), the fromCombo is blurred, which will cause closing of the popup. Check this jsfiddle, which shows what I mean.

#Tom
Check the aforementioned jsFiddle demo. You will notice that you will need to hide _arrow.parent(), because the click event is wired to the _arrow parent.


Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Tom
Top achievements
Rank 1
answered on 03 Dec 2011, 09:44 AM
I think my problem may have been due to IE running in compatibility mode - dont remember seeing the icon showing as such but f12 development tools said it was. Added <meta http-equiv="X-UA-Compatible" content="IE=Edge" />  in the header and fixed that. Thanks for your help.
Tags
ComboBox
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Tom
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or