Telerik Forums
Kendo UI for jQuery Forum
1 answer
46 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
145 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
450 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
96 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
276 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
683 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
431 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
86 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
3 answers
57 views
How can i get a scroll bar like on sitefinity.com?

Does it use kendo UI ?
Sebastian
Telerik team
 answered on 21 Feb 2013
1 answer
56 views
I didn't know where to put this.
It looks like this demo the code and what is rendered at the top do not match. http://demos.kendoui.com/web/grid/rowtemplate.html

the rendered has rows with column headings 
Cover Title Rating


and this is what the code says they should be.

.Columns(columns =>
    {
        columns.Bound(c => c.CustomerID).Title("Picture");
        columns.Bound(c => c.ContactName).Title("Name");
        columns.Bound(c => c.CompanyName);
        columns.Bound(c => c.Country);
        columns.Bound(c => c.Address);
        columns.Bound(c => c.Phone);
    })

I still get the concept I think but it would be nice if they actually matched.l

Atanas Korchev
Telerik team
 answered on 21 Feb 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?