Telerik Forums
Kendo UI for jQuery Forum
1 answer
582 views
Hi,

I have a series of UI controls bound to a model using MVVM.  One of the controls is a dropdownlist which has it's data loaded from a remote datasource.   I also have a button besides the dropdown which launches a popuo window. The window allows a new item to be added to the database. 

After this new item is added I would like to force my DDL to rebind to the remote datasource and refresh it's data.

My layout is:

<div id="myDiv>
<div class="k-edit-label">
<label for="DESCRIPTION">Description</label>
</div>
<div data-container-for="DESCRIPTION" class="k-edit-field">
<input type="text" class="k-input k-textbox" name="DESCRIPTION" data-bind="value: DESCRIPTION">
</div>

<div class="k-edit-label">
<label for="GROUP_ID">Group</label>
</div>
<div data-container-for="GROUP_ID" required class="k-edit-field">
<select name="GROUP_ID"
id="GROUP_ID"
data-role="dropdownlist"
data-text-field="GROUP_NAME"
data-value-field="GROUP_ID"
data-source=loadGroup()
data-bind="value: GROUP_ID"
></select> 

<a id="newGroup" class="k-button" >New</a>
</div> 

LoadGroup() will call a web service and will return a list of records which are populated in the dropdownlist.
I make an ajax call to get the model data then bind it to the model like:
datasetMetaModel = kendo.observable({
datasetMeta: datasetModel
});

kendo.bind($("myDiv"), datasetMetaModel);

After the popup window is shown, the new record added and saved to the DB I do the following to try to rebind the dropdownlist

kendo.init($("#GROUP_ID"));
 var dropDownList = $('#GROUP_ID').data('kendoDropDownList');
 dropDownList.dataSource.read();
dropDownList.refresh();

The remote webservice is definitely being hit again and is returning the new data however the dropdown list is never updated.  I'm pretty sure I'm just missing a simple step but can't figure out what it is.
Petur Subev
Telerik team
 answered on 15 Jul 2013
1 answer
1.5K+ views
In my column, i wish to display the client footer as a 2 decimal number, right aligned. How do I edit the ClientFooterTemplate to do that:

So far I have the sum appearing fine, just not formatted:

columns.Bound(e => e.MarketValue).Title("Mkt. Value ($)")
       .ClientFooterTemplate("#=sum#")
       .HeaderHtmlAttributes(new { style = "text-align: right;" })
       .HtmlAttributes(new { @class = "aright" });


Kiril Nikolov
Telerik team
 answered on 15 Jul 2013
1 answer
49 views
I am developing project for mobile and tablet using Kendo UI Complete  for ASP.NET MVC and have a few basic questions regarding
mobile development and Kendo.

 1. Will Kendo UI Complete for ASP.NET MVC support in all the mobile os ?

 1.1.   If yes, then what are all the mobile os it will support?

2. Will Kendo UI Complete for ASP.NET MVC support  in all the tablets?

2.1 If yes, then what are tablet it will work?

3.  Suppose if I purchase Kendo UI complete for ASP.NET MVC, will I get Kendo UI complete along with it? From the information I got
from your website, Kendo UI Complete supports all mobile devices and tablets, but don’t know what Kendo UI Complete for ASP.NET MVC can
offer.

Please refer the link given below.
http://www.kendoui.com/server-wrappers/mvc.aspx

 
4.       
When I saw forums in Kendo Website, many mentioned that Kendo UI Complete for ASP.NET MVC does not get adapted to different mobile
platforms unlike Kendo UI Complete. So I want clarifications as to what I have to purchase so as to support all mobile and tablet os platforms.

Please refer the link given below.

http://www.kendoui.com/forums/mvc/general-discussions/mvc-and-kendo-mobile-ui-and-openaccess-orm.aspx

Thankyou
Rajthilak.S

 
Kiril Nikolov
Telerik team
 answered on 15 Jul 2013
1 answer
88 views
Hi,

I making a simple autocomplete with remote json data, but it's not working, any idea?
thanks.

                var dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        dataType: "json",
                        url: "http://www.crystalgroup.info/index.php/ajax/customer"
                    }
                  }
                   
            });
 
            $("#input_customer").kendoAutoComplete({
                dataTextField: "title",
                filter: "contains",
                minLength: 2,
                dataSource:dataSource
            });
CH
Top achievements
Rank 1
 answered on 15 Jul 2013
2 answers
1.5K+ views
I am using a kendoDropDownList in cell edit mode. User can select the value of the drop down list through keyboard. When they press Enter, the new value is saved back to the dataSource.

From here, two things I am trying to do. One is additional keyboard support for using left and right arrow to submit the new value too. Another one is pressing a key to cycle through all options begin with that key.
Eg. if it's a list about cities in U.S., pressing C will select Cleveland, pressing C again will select Colorado Springs etc.

What I done is hook up a downDown event to the kendoDropDownList during the grid edit event handler.
edit: function (e) {
                    var input = e.container.find('input');
                    var currentValue = input.val();
                    if (e.container.find('.k-dropdown').length > 0) {
                        input = e.container.find('.k-dropdown');
                        currentValue = e.container.find('.k-input').text();
                    }
 
                    input.off('keydown', handleKeyDown);
                    input.on('keydown', null, { input: input, value: currentValue, isDropDownList: (e.container.find('.k-dropdown').length > 0) }, handleKeyDown);
                },
In the event handler, I figured out the next value to select, then I ran a problem. I don't know how to get this value saved back to the dataSource. I tried a couple of ways like.
$(el).find('input').data('kendoDropDownList').select(selectedIndex + 1);
$(el).find('input').data('kendoDropDownList').value(newValue);
$(el[0]).find(".k-input").text(newValue);
In the debugging, I can see kendroDropDownList.value() does give me the newValue. But that is just changed at the drop down list, the underlying dataSource is not changed. so when I do grid.closeCell(), or grid.SaveRow(), the old value is populated back to the drop down list.

There must be a step in between that will make the grid commit changes to its dataSource, please help.

Thank you
ITS
Top achievements
Rank 1
 answered on 14 Jul 2013
1 answer
150 views
By default the Kendo Grid for ASP.NET MVC will perform server side requests and load the page and grid on a single request. However, when configured for ajax binding the Kendo Grid for ASP.NET MVC will make ajax requests after the page is loaded which requires one extra request (one for the page and one extra for the data used by the grid). Is there a way to combine Server Binding and Ajax Binding to eliminate the extra request made in Ajax binding? All I'm looking for is to load the data for the page and grid at the same request (like Server Side Binding) for the first time and use Ajax Binding for subsequent requests. To disable the initial load on Ajax Binding we can disable the AutoBind Configuration Option (autoBind:false) of the grid. Now, I need a way to show the data on the grid. 

Josh
Top achievements
Rank 1
 answered on 13 Jul 2013
4 answers
133 views
We recently purchased the Kendo MVC wrappers.  Now an MVC4 app that uses the Kendo menus and worked with the trial license, doesn't display any of the menus that have sub-menus until you either resize the window or mouse over the menu.  Menu items that have no children display when the page initially renders.  We see this only in IE 10.  Firefox, Chrome, & Safari all show-up as expected.
Tom
Top achievements
Rank 1
 answered on 12 Jul 2013
0 answers
92 views
I just worked through adding a MultiSelect fillter on a page with a grid, and didn't see anything in the forums that addressed this issue, so I thought I would post the result that I came up with.
<%= Html.Kendo().MultiSelectFor(m => m.FilterRoleIds)
        .Placeholder("Select Roles")
        .DataTextField("RoleName")
        .DataValueField("ApRoleId")
        .BindTo(ViewBag.ApRolesList)
%>
  
<%= Html.Kendo().MultiSelectFor(m => m.FilterCompanyIds)
        .Placeholder("Select Companies")
        .DataTextField("CompanyName")
        .DataValueField("CompanyId")
        .BindTo(ViewBag.CompanyList)
%>
  
<script language="javascript" type="text/javascript">
    function additionalData() {
        return {
            roleIds: "<%= ApRoleController.ReturnListValues(Model.FilterRoleIds) %>",
            companyIds: "<%= ApRoleController.ReturnListValues(Model.FilterCompanyIds) %>"
        };
    }
</script>
 
        public static string ReturnListValues(List<string> list)
        {
            if (list == null || list.Count == 0) return "";
 
            string s = string.Empty;
 
            foreach (var item in list)
            {
                if (s != string.Empty)
                    s += ",";
 
                s += item;
            }
 
            return s;
        }
Above is what I came up with.
Telerik came up with the following:
<script language="javascript" type="text/javascript">
    function additionalData() {
        var roleIds = <%= Html.Raw(Json.Encode(Model.FilterRoleIds)) %>;
        var data = {};
        for(var i=0; i< roleIds.length;i++){
            data["FilterRoleIds[" + i + "]"] = roleIds[i];
        }
        return data;
    }
</script>
Hopefully, this will be helpful to somebody.
Atlas
Top achievements
Rank 1
 asked on 12 Jul 2013
2 answers
152 views
Hi, I have a dropdownlist that I refresh with other code. It loads a list of items to process, once an item is processed the item is basically marked as done and when the dropdownlist is refreshed it no longer is in the dropdownlist. This works just fine till I get to the last item, when it is processed and the dropdownlist is refreshed the json basically returns a empty List<ViewModels.DayEndCycleNumbersViewModel>, 0 items, what happens it the dropdownlist isn't cleared to nothing. If I refresh the page the dropdownlist is empty. How can I get the dropdownlist to be empty when it is refreshed?

Thanks,
John
John
Top achievements
Rank 1
 answered on 12 Jul 2013
1 answer
81 views
I'm using Pie Charts in a mobile ScrollView. On PC, while hovering the charts with mouse cursor, each pie is highlighted by creating an overlay. This overlay prevents me from swiping through views. How can  I disable it?

seriesHover: function(e){
   e.preventDefault()
}
The above is not working, even though it gets triggered every time. Of course, on mobile there is no mouseover, but when you tap and swipe, the overlay gets toggled, so swiping works only half of the time .

Alexandru
Top achievements
Rank 1
 answered on 12 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?