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

   I'm using Kendo UI Drag & Drop library in my project. In sample, I found how to use 'Div" with drag & drop. But my requirement is to use drag & drop between two iframes. Can you share your ideas about how to implement this functionality.
Petyo
Telerik team
 answered on 22 Feb 2013
1 answer
1.2K+ views
I am trying to bind a checkbox to a column in the grid. Actually I was able to display and ticked the check box according to the Boolean value when the datasource is being bound to the grid. but when I tried to do inline editing check box disappears. I used a template field to display the check box.

 template: '<input type="checkbox" #= Archived ? "checked=checked" : "" # ></input>'

but when click edit button it will turn in to a checkbox. I tried following demo

http://demos.kendoui.com/web/grid/editing-custom.html

but there is no way to bind a checkbox to it's container like .appendTo(container).kendoDropDownList(" 

Help me please with a code sample , if you can .


Vladimir Iliev
Telerik team
 answered on 22 Feb 2013
1 answer
27 views
User Interfaces are rendering differently in browsers, buttons shapes are coming as square in even IE8 verion, but its working in chrome.
Alexander Valchev
Telerik team
 answered on 22 Feb 2013
1 answer
99 views
Curious if there's a way to change the year range that's displayed when a user drills down on the datepicker header? specifically when they get to the level where decade blocks are shown.  See attached pic for an example

In the attached file I've got a datepicker where the min and max are set so users can't select anything that's not in the range 2010-2013, however the header of the datepicker is displaying 2010-2019.  Is there a way to modify that so it only shows the range specified by the min/max values??

Georgi Krustev
Telerik team
 answered on 22 Feb 2013
2 answers
421 views
Hello,

We are unable to call some of the REST api's via Kendo framework , which we had successfully called via Jquery ajax requests.
Here below given are the
1. C# Code example of the REST API.
2. Code example which can successfully call the REST API
via jquery ajax request.
3. Format which we have used to call  the REST API
from kendo framework.

It would appreciated if you can provide us with the correct Kendo code format to call this REST api.

1. C# Code example of the REST API.

    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
    //[AuthenticatingHeader]
    public partial class Account
    {
 
 
        [WebInvoke(Method = "POST", UriTemplate = "DeleteAccount?uniqueaccessid={uniqueaccessid}", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat =
 
WebMessageFormat.Json)]
        public static void DeleteAccount(string uniqueaccessid, string accountId)
        {
            int userid = Accessibility.GetUserId();
            if (userid > 0)
            {
                string output = Tools.ServiceLayer.Account.DeleteAccount(Convert.ToInt32(accountId), Convert.ToInt32(userid)).ToString();
                HttpContext.Current.Response.ContentType = "application/json; charset=utf-8";
                HttpContext.Current.Response.Write(output);
            }
        }
    }


2. Code example which can successfully call the REST API
via jquery ajax request. 

function GetTransactionAccount(uniqueaccessid, accountId) {
  var jData = {};
      jData.uniqueaccessid = uniqueaccessid;
      jData.accountId = accountId;
      $.ajax({
          url: RestBaseURL + "Account/"DeleteAccount?uniqueaccessid=" + uniqueaccessid + "",
          data: JSON.stringify(jData),
          dataType: "json",
          type: "POST",
          async: false,
          contentType: "application/json; charset=utf-8",
          cache: false,
          success: function (response) {
              alert(response);
 
          },
          failure: function () { alert("failed"); }
      });
  }


3. Format which we have used to call  the REST API
from kendo framework.


    var changeaccid;
    function GetAccountInfo(uniqueaccessid) {
     
    var accid;
 
               var dataSourceobj = new kendo.data.DataSource({
                transport: {
                     read:{
                        url:RestBaseURL + "Cash/GetAccountInfo?uniqueaccessid=" + uniqueaccessid + "",
                        dataType: "json",
                         type: "POST"
                          },
 
                    destroy:{
                        url: RestBaseURL + "Account/DeleteAccount?uniqueaccessid=" + uniqueaccessid ,
                        //url: RestBaseURL + "Account/DeleteAccount",
                        dataType: "json",
                        type: "POST"
                         },
                    parameterMap: function(options, type) {
                    if (type == "destroy") {
                    return {
                    'uniqueaccessid': uniqueaccessid,
                    'accountId': options.models[0].id
                     
                           };
                                         }
                                                          }
 
                },        
                batch: true,
                pageSize: 10,
                schema: {
                    type: "json",
                    model: {
                        fields: {
                            id : {type: "number"},
                            lender: { type: "string" },
                            id: { type: "string" },
                            rate: { type: "number" },
                            startingbalance: { type: "number" },
                            emergencyfund: { type: "number" },
                            startingdate: { type: "date" },
                            balance: { type: "number" }
                                }
                            }
                        }
                 });      
                   
                 $("#grid2").kendoGrid({
                    dataSource: dataSourceobj,
                    height: 130,
                    selectable: "multiple",
                    change: function() {
                        changeaccid = this.dataItem(this.select()).id;
                    },
                    sortable: true,
                    resizable: true,
                    reorderable: true,
                    filterable: true,
                    columnMenu: true,
                    pageable:true,
                    columns: [
                            { title:"" ,template: "<img src='images/ico/acc_on.png'  title='Green: Consider for Debt eliminator payoff. Red: Not consider
 
for Debt eliminator payoff'/>",width: "25px"},
                            { title:"Id",field: "id" ,width: "30px"},
                            { title:"Bank Name",field: "lender" ,width: "185px"},
                            { title:"A/C Number",field : "accountnumber" ,width: "90px"},
                            { title:"Interest Rate%",field: "rate",format: "{0:N}",width: "110px" },
                            { title:"Beg. Balance",field: "startingbalance", format: "{0:c}",width: "95px"},
                            { title:"Emerg. Fund",field: "emergencyfund" , format: "{0:c}",width: "95px"},
                            { title:"Opening Date",field: "startingdate" ,template: '#= kendo.toString(startingdate,"MM/dd/yyyy") #',width: "100px"},
                            { title:"Balance", field: "balance" , format: "{0:c}",width: "70px"},
                            //{ title:"Action", template: "<img src='images/ico/edit.png' title='Edit'/><img src='images/ico/delete.png'
 
title='Delete'/>",width: "50px"}],
                            {title:"Action", command: ["edit", "destroy"], width: "130px" }],
                    editable: "inline"
                    });
  
 
 
 
    }


Kindly provide us with correct code to call the API.


Thanks in advance
Millennium
Top achievements
Rank 1
 answered on 22 Feb 2013
2 answers
75 views
Can the data of a Node contain the datasource that should be used to obtain its children ?

Consider a complicated heterogeneous environment. 
Some level in a tree has
Item-1 type X
Item-2 type X
Item-3 type Y
Item-4 type Z
Item-5 type A

When a node on this level is expanded, the type will be used to select the data source
Case X: Use backend table V_NEW_X 
Case Y: Use dynamic query constructed based on ui fields on page
Case Z: Use items the server scrapes from black box legacy webpage
Case A: Use static array in page

Thanks,
Richard


Richard
Top achievements
Rank 1
 answered on 21 Feb 2013
1 answer
175 views
hello:
I have a problem about StockChart. Our requirement is to add new data to the StockChart after I get the new data from server. the following code is just a test fragment. But the problem is in the update function when I add the new data to StockChart. the stockchart will totally redraw all the chart. If add the new data to the chart frequently, it is not tolerated. we just need to add the new data at the end of line chart smoothly.  So do you know some options that I can use in this case?
         
  $("#container").kendoStockChart({
                title: {
                    text: "My test"
                },
                dateField: "D",
                dataSource: {
                  transport: {
                      read:"url to get datas"
                  }
              },
                series:[{
                    type:"line",
                    field:"V"
                }],
                axisDefaults:
                {
                    valueAxis: {
                        labels: {
                        template: "#=value#",
                        visible: true
                    }
                    }
                },
                navigator: {
                    series: {
                        type:"line",
                        field:"V"
                    }
                }
            });


            var updatefunction = function () {

                var kendoStockChart = $("#container").data("kendoStockChart");
                var d = new Date();
                kendoStockChart.dataSource.add({"D":d.getTime(),"V":1000});
                setTimeout(updatefunction, 10000);

            };
            setTimeout(updatefunction, 10000);
Iliana Dyankova
Telerik team
 answered on 21 Feb 2013
3 answers
640 views
Hi,
I have a grid that the pageSize will be 200 if is not iPad, and page size will be 20 if is rendered on iPad.
The end product will be just to iPad and Desktop, how can I do this checking using MVC Html Helper?
@(
 Html.Kendo().Grid(Model)
 
                .Name("Grid")
                .ClientDetailTemplateId("inventoryTemplate")
 
                .DataSource(ds => ds.Ajax()
                                .PageSize(200) // or .PageSize(20) if iPad
                                .Model(m =>
                                {
                                    m.Id(p => p.StockID);
                                })
                        .Read(r => r.Action("Read", "Home"))
)
Jose
Top achievements
Rank 1
 answered on 21 Feb 2013
3 answers
383 views
I have having a tough time figuring out how to achieve simply bindings in a tree view template:

This is my requirement:

- Bind checkbox of each node to an isVisible property on the node's underlying view model.  
- Bind click action of delete button to a method called remove() on the node's underlying view model.   

Treeview is bound to an underlying hierarchical datasource.  Items in datasource are created and added dynamically like this:


        createCategoryLegendModel(viewModel) {             
             return {
                 text : viewModel.label,
                 imageUrl:  this.url + viewModel.imagePath,  
                 expanded : true,                                    
                 viewModel: viewModel,
                 callme: function () { alert("view model called"); },  // test method            
                 layers :  [] 
             };
         }

dataSource.add(createCategoryLegendModel(viewModel));

This is the template I have:

<script id="treeview-template" type="text/kendo-ui-template">           
        <input type="checkbox" data-bind="checked : item.viewModel.isVisible" style = "margin-left:-5px"></input>                 
        <img data-bind="click : callme" title="click to remove"  src="@Url.Content("~/images/delete.png")" style ="margin-top:0px; height:16px; width:16px"/>          @* or item.viewModel.remove, which ever I can get to work *@
        <span> #: item.viewModel.label #</span>                    
        <span data-bind="text : text"> </span>          @* why does this not work *@    
</script>


Now, your checkbox example, shows how to render, but does not show us how to bind to an underlying view model.  So it does not really help me much.  Your  templates shows me how to render a button, but not how to bind its click to an underlying view model method yet these are things easily done using Knockout.   Also, I the way you bind click actions on the delete button in your templates sample, is susceptible to performance problems and breaks down my MVVM strategy.
Klaus
Top achievements
Rank 1
 answered on 21 Feb 2013
1 answer
67 views
Can I use kendoDropDownList with kendo mobile license ? I can see that is in kendoDropDownList kendouiweb section.
Sebastian
Telerik team
 answered on 21 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?