Telerik Forums
Kendo UI for jQuery Forum
1 answer
97 views
Is it possible using the multi select dropdown list to select multiple items at once by pressing and holding the "ctrl" key on the keyboard and selecting items from the drop down at once?

If yes, can you please share a small code snippet?

Thanks in adv.
Kiril Nikolov
Telerik team
 answered on 22 Apr 2014
1 answer
109 views
Hi,

Kendo Menu stop working after upgrading Kendo from 2013.3.1119 to 2013.3.1324.
Please go through plunkers and try out. Some times you'll observe that sub menu not displayed on hovering when we clicked on parent menu.
1. http://plnkr.co/edit/JW0rn48s6AAJPgUPlAmr?p=preview - Not working on version 2013.3.1324
2. http://plnkr.co/edit/uhdwCUbIjONQcOKNq56A?p=preview - Working on version 2013.3.1119


Please let me know if we have any workaround to fix this issue on 2013.3.1324?


Regards,
Vinay
Kamen Bundev
Telerik team
 answered on 22 Apr 2014
2 answers
273 views
Hi,

I am trying to work on the grid like below,

 basically i give a checkbox to user, when it is not checked, the grid only display data from URL1,
but if the checkbox is checked, it merge 2 json data and display the comparison of URL1 and URL 2

<label><input type="checkbox" name="compCB" id="compCB">Enable Compare</label>
<div id="grid" style="height: 365px"></div>
<script>
$(document).ready(function () {
  var url1="http://XXXXXXXXX/clients/1";
  var url2="http://XXXXXXXXX/clients/2";
  var J1=null;
  var J2=null;
  var Jdata;
  var toCompare;
  loadData('init');

  function loadData(act){
    toCompare =$('#compCB').is(':checked');
      if(act=='init'||act=='reload'){
        $.getJSON(url1, function(jd) {
          J1=jd;
          meargeData();
        });
      };
      if(toCompare){
        $.getJSON(url2, function(jd) {
          J2=jd;
          mergeData();
        });
      }else if(act='toggle'){
        J2=null;
        mergeData();
      };
    };
    function mergeData(){
      if(J1!=null&&(J2!=null||!toCompare)){
        if(!toCompare){
          Jdata=[{
            clientId: J1.clients[0].clientId,
            name: J1.clients[0].name,
            status: J1.clients[0].status
          }];
        }else{
          Jdata=[{
            clientId: {
              C1: J1.clients[0].clientId,
              C2: J2.clients[0].clientId
            },
            name: {
              N1: J1.clients[0].name,
              N2: J2.clients[0].name
            }, 
            status: {
              S1: J1.clients[0].status,
              S2: J2.clients[0].status
            }
          }];
        };
        genGrid();
      };
    };
    function genGrid(){
      if(!toCompare){
        RT='<tr data-uid="#= uid #"><td>#: clientId #</td><td><strong>#: name #</strong></td><td style="text-transform:lowercase;">#: status #</td></tr>';
        ART='<tr data-uid="#= uid #" style="background-color:rgb(255,200,255)"><td>#: clientId #</td><td><strong>#: name #</strong></td><td style="text-transform:lowercase;">#: status #</td></tr>';
      }else{
        RT='<tr data-uid="#= uid #"><td>#: clientId.C1 #<br/>#: clientId.C2 #</td><td><strong>#: name.N1 #<br/>#: name.N2 #</strong></td><td style="text-transform:lowercase;">#: status.S1 #<br/>#: status.S2 #</td></tr>';
        ART='<tr data-uid="#= uid #" style="background-color:rgb(255,200,255)"><td>#: clientId.C1 #<br/>#: clientId.C2 #<br/></td><td><strong>#: name.N1 #<br/>#: name.N2 #</strong></td><td style="text-transform:lowercase;">#: status.S1 #<br/>#: status.S2 #</td></tr>';
      };
      $("#grid").kendoGrid({
        dataSource: {
          type: "json",
          data: Jdata,
          pageSize: 3,
        },
        groupable: true,
        sortable: true,
        resizable: true,
        columnResizeHandleWidth: 6,
        pageable: {
          refresh: true,
          pageSizes: true,
          buttonCount: 5
        },
        columns: [{
          title: "ID",
          width: 200
        }, {
          title: "Client Name",
          width: 250
        }, {
          title: "Status"
        }],
        rowTemplate: RT,
        altRowTemplate: ART
      });
    };
    $('#compCB').change(function(){
      loadData('toggle');
    });
  });
</script>

Now, I am trying to do it in the MVVM structure, the first problem I face is how do I change the  rowTemplate and altRowTemplate dynamicly?


 





Wesley
Top achievements
Rank 1
 answered on 22 Apr 2014
2 answers
144 views
Hi!
I have a listview containing a template with a sparkline in.
I have around 15 items in the listview and it takes about 8 seconds to load the page and create all the sparklines.
Today, nothing is shown before all sparklines are created (i'm using the data-init event).
It feels like the application has stoped responding so I want to change this behaviour.

I want the page to load faster and after it has finished loading, it start to create the sparkline asynchronisly (like ajax updates)
Is this possible?

Regards,
Per
Per
Top achievements
Rank 1
 answered on 21 Apr 2014
2 answers
114 views
I have a view which has a listview inside. When I click on an item a ModalView which shows the detail is opening. When I click remove, the item is being removed. 

My problem is, when I click on an item inside the listview, the dialog is openning again with the related data but the button is not enabled.

What am I doing wrong?

function closeModalViewRemove() {
   
  $("#modalview-app-remove").kendoMobileModalView("close");

};


function deleteFromJson() {
 
  var $app_list = localStorage.getItem('LsAppList');
  var AppListJson = JSON.parse($app_list);

    jQuery.each(AppListJson, function(i, val) {
                                         if (AppListJson[i].extapp_id == appdetail.get("addAppId"))
{    
    AppListJson.splice([i], 1);
$app_list = JSON.stringify(AppListJson);
localStorage.setItem('LsAppList',$app_list);
closeModalViewRemove();
 
}
}); 


}
goex
Top achievements
Rank 1
 answered on 21 Apr 2014
1 answer
182 views
Hi,

I am trying ‘Save all changes with one request’ (http://www.telerik.com/support/code-library/save-all-changes-with-one-request) solution. I modified UpdateCreateDelete() method to return  modified data as response to the request. Now I want to make datasource and grid update
themselves smoothly without the additional roundtrip caused by calling read().

Please suggest how I may do this.

public ActionResult UpdateCreateDelete([DataSourceRequest] DataSourceRequest request,
            [Bind(Prefix = "updated")]List<Order> updatedOrders,
            [Bind(Prefix = "added")]List<Order> newOrders,
            [Bind(Prefix = "deleted")]List<Order> deletedOrders)
        {
            if (updatedOrders != null && updatedOrders.Count > 0)
            {
                for (int i = 0; i < updatedOrders.Count; i++)
                {
                    var target = orderList.Where(o => o.OrderID == updatedOrders[i].OrderID).FirstOrDefault();
  
                    if (target != null)
                    {
                        int targetIndex = orderList.IndexOf(target);
                        orderList[targetIndex].OrderDate = updatedOrders[i].OrderDate;
                        orderList[targetIndex].EmployeeID = updatedOrders[i].EmployeeID;
                        orderList[targetIndex].OrderDescription = updatedOrders[i].OrderDescription;
                    }
                }
            }
  
            if (newOrders != null && newOrders.Count > 0)
            {
                for (int i = 0; i < newOrders.Count; i++)
                {
                    newOrders[i].OrderID = orderList[orderList.Count - 1].OrderID + 1;
                    orderList.Add(newOrders[i]);
                }
                
            }
  
            if (deletedOrders != null && deletedOrders.Count > 0)
            {
                for (int i = 0; i < deletedOrders.Count; i++)
                {
                    var target = orderList.Where(o => o.OrderID == deletedOrders[i].OrderID).FirstOrDefault();
  
                    if (target != null)
                    {
                        orderList.Remove(target);
                    }
                }
            }
  
            List<Order> responseOrders = new List<Order>();
            responseOrders.AddRange(updatedOrders);
            responseOrders.AddRange(newOrders);
            responseOrders.AddRange(deletedOrders);
  
            return Json(responseOrders.ToDataSourceResult(request, ModelState));
  
            //return Json("Success!");
        }
  
<script>  
    function sendData() {
        var grid = $("#Grid").data("kendoGrid"),
            parameterMap = grid.dataSource.transport.parameterMap;
        
        //get the new and the updated records
        var currentData = grid.dataSource.data();
        var updatedRecords = [];
        var newRecords = [];
  
        for (var i = 0; i < currentData.length; i++) {
            if (currentData[i].isNew()) {
                //this record is new
                newRecords.push(currentData[i].toJSON());
            } else if(currentData[i].dirty) {       
                updatedRecords.push(currentData[i].toJSON());
            }
        }
  
        //this records are deleted
        var deletedRecords = [];
        for (var i = 0; i < grid.dataSource._destroyed.length; i++) {
            deletedRecords.push(grid.dataSource._destroyed[i].toJSON());
        }
        
        var data = {};
        $.extend(data, parameterMap({ updated: updatedRecords }), parameterMap({ deleted: deletedRecords }), parameterMap({ added: newRecords }));
  
        $.ajax({
            url: "/Home/UpdateCreateDelete",
            data: data,
            type: "POST",
            error: function() {
                //Handle the server errors using the approach from the previous example
            },
            success: function (result) {
  
                // How to make datasource and grid update themselves smoothly without the additional roundtrip caused by calling read()              
                 
            }
        });
    }
</script>

 
Alexander Popov
Telerik team
 answered on 21 Apr 2014
1 answer
187 views
Hello
I know there is currently no clustering support for DataViz Map.

I would like to ask about possible solution to use 3rd party library like Leaflet or OpenLayers. I've tried to find in documentation place where I can put my code to display cluster. I cannot find dataBound event like in other controls to make operations on data source.

To clarify. I want to use DataSource to download remote data necessary to display complex tooltip and cluster. So I need the place on map widget where I can start rendering such data using 3rd party library.

Kind Regards
Marcin
Alexander Popov
Telerik team
 answered on 21 Apr 2014
1 answer
184 views
Hi all,

I am using the Kendo controls in a MVC4 project. In one of the pages I'd like to get drag and drop functionality just exactly like in this Kendo ASP.NET Control:
https://demos.telerik.com/aspnet-ajax/listview/examples/itemdragdrop/defaultcs.aspx


Have anyone implemented something similar??

Cheers
Alexander Valchev
Telerik team
 answered on 21 Apr 2014
5 answers
834 views

Called CSS and JS files from telerik
        <link href="http://cdn.kendostatic.com/2014.1.416/styles/kendo.default.min.css" rel="stylesheet" />
        <link href="http://cdn.kendostatic.com/2014.1.416/styles/kendo.mobile.all.min.css" rel="stylesheet" />
        <script src="http://cdn.kendostatic.com/2014.1.416/js/jquery.min.js"></script>
        <script src="http://cdn.kendostatic.com/2014.1.416/js/kendo.all.min.js"></script>
HTML

<body>
    <div style="margin-top: 25px; margin-left: 180px">
              <input id="bookyear" style="width: 150px;" />
     </div>
    <script>
        $(document).ready(function () {
            $("#bookyear").kendoDropDownList({
                dataTextField: "Book",
                dataValueField: "RegionSize",
                dataSource: {
                    transport: {
                        read: {
                            type: "POST",
                            contentType: "application/json; charset=utf-8",
                            //data: "{}",
                            dataType: "json",
                            url: "Default2.aspx/GetBooks",
                        }
                    }
                }
            });
        });
    </script>
    <script>
        var app = new kendo.mobile.Application(document.body, {
            transition: 'slide'
        });
 
        //function showLoading() {
        //    app.showLoading();
        //    setTimeout(function () {
        //        app.changeLoadingMessage("Getting Data... Please wait...");
        //    }, 1000);
        //}
        </script>
</body>
</html>

The Returned JSON from fiddler
{"d":[{"__type":"SpecMobi.Books","Book":"ABTX","RegionSize":"Texas_Tall3"},{"__type":"SpecMobi.Books","Book":"ASPN","RegionSize":"West_Short3"},{"__type":"SpecMobi.Books","Book":"BATE","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"BCTX","RegionSize":"Texas_Tall3"},{"__type":"SpecMobi.Books","Book":"BRAN","RegionSize":"East_Tall2"},{"__type":"SpecMobi.Books","Book":"BRBN","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"BVAR","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"CARL","RegionSize":"Texas_Tall2"},{"__type":"SpecMobi.Books","Book":"CEMS","RegionSize":"East_Tall2"},{"__type":"SpecMobi.Books","Book":"CHER","RegionSize":"East_Tall2"},{"__type":"SpecMobi.Books","Book":"CMOK","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"CRAG","RegionSize":"West_Short2"},{"__type":"SpecMobi.Books","Book":"CRAW","RegionSize":"East_Tall2"},{"__type":"SpecMobi.Books","Book":"CRTH","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"DLTA","RegionSize":"West_Tall2"},{"__type":"SpecMobi.Books","Book":"ENMR","RegionSize":"Texas_Tall2"},{"__type":"SpecMobi.Books","Book":"ESPN","RegionSize":"West_Short2"},{"__type":"SpecMobi.Books","Book":"ESTE","RegionSize":"East_Tall2"},{"__type":"SpecMobi.Books","Book":"EURE","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"FOUR","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"FTSM","RegionSize":"East_Tall3"},{"__type":"SpecMobi.Books","Book":"GRCT","RegionSize":"West_Short2"},{"__type":"SpecMobi.Books","Book":"GROV","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"GRTD","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"HARR","RegionSize":"East_Tall2"},{"__type":"SpecMobi.Books","Book":"HOBB","RegionSize":"Texas_Tall2"},{"__type":"SpecMobi.Books","Book":"JBAR","RegionSize":"East_Short3"},{"__type":"SpecMobi.Books","Book":"JPLN","RegionSize":"East_Tall3"},{"__type":"SpecMobi.Books","Book":"KFTX","RegionSize":"Texas_Tall3"},{"__type":"SpecMobi.Books","Book":"KVTX","RegionSize":"Texas_Short2"},{"__type":"SpecMobi.Books","Book":"LCVI","RegionSize":"West_Tall2"},{"__type":"SpecMobi.Books","Book":"LHRP","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"LOAL","RegionSize":"West_Short2"},{"__type":"SpecMobi.Books","Book":"LSVG","RegionSize":"West_Short2"},{"__type":"SpecMobi.Books","Book":"LUTX","RegionSize":"Texas_Short4"},{"__type":"SpecMobi.Books","Book":"MAYE","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"MCID","RegionSize":"West_Short2"},{"__type":"SpecMobi.Books","Book":"MGCT","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"MLTX","RegionSize":"Texas_Tall3"},{"__type":"SpecMobi.Books","Book":"MONE","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"MOSC","RegionSize":"West_Tall2"},{"__type":"SpecMobi.Books","Book":"NEOS","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"NVDA","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"NWAR","RegionSize":"East_Tall3"},{"__type":"SpecMobi.Books","Book":"ODTX","RegionSize":"Texas_Tall3"},{"__type":"SpecMobi.Books","Book":"OXFD","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"OZNX","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"PENV","RegionSize":"Texas_Tall2"},{"__type":"SpecMobi.Books","Book":"PGAR","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"PITT","RegionSize":"East_Tall2"},{"__type":"SpecMobi.Books","Book":"PRSN","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"ROSW","RegionSize":"Texas_Tall2"},{"__type":"SpecMobi.Books","Book":"SARK","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"SNAN","RegionSize":"Texas_Tall3"},{"__type":"SpecMobi.Books","Book":"SOTX","RegionSize":"Texas_Short2"},{"__type":"SpecMobi.Books","Book":"SPFD","RegionSize":"East_Tall3"},{"__type":"SpecMobi.Books","Book":"SSAR","RegionSize":"East_Short2"},{"__type":"SpecMobi.Books","Book":"STBT","RegionSize":"West_Tall2"},{"__type":"SpecMobi.Books","Book":"STFE","RegionSize":"West_Tall2"},{"__type":"SpecMobi.Books","Book":"SUMM","RegionSize":"West_Short3"},{"__type":"SpecMobi.Books","Book":"SUNV","RegionSize":"West_Short3"},{"__type":"SpecMobi.Books","Book":"SWID","RegionSize":"West_Tall2"},{"__type":"SpecMobi.Books","Book":"TAOS","RegionSize":"West_Tall2"},{"__type":"SpecMobi.Books","Book":"TBTX","RegionSize":"Texas_Tall3"},{"__type":"SpecMobi.Books","Book":"TELL","RegionSize":"West_Short2"},{"__type":"SpecMobi.Books","Book":"VAIL","RegionSize":"West_Short3"},{"__type":"SpecMobi.Books","Book":"WNMR","RegionSize":"Texas_Short2"}]}

The DropDownList is blank, no data. nothing.


what am I missing here










Kiril Nikolov
Telerik team
 answered on 21 Apr 2014
10 answers
2.8K+ views
I have a form where I make a call to the server and it gives me an array of errors that contains the key of the field and the message. How can I simply show these messages through the validation widget? 

Something like:

validator.AddError("Subject","My custom error from server");

Alexander Valchev
Telerik team
 answered on 21 Apr 2014
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
DropDownTree
ListBox
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?