Telerik Forums
Kendo UI for jQuery Forum
2 answers
112 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
179 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
182 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
181 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
826 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
1 answer
171 views
Hello, I am fairly new to using Kendo UI in my Asp.Net applications and need some help in using it in my application.

I would like the Editor to be autosize (Expand or shrink depending on the text the user inputs in) and wondering if this functionality exists with the editor or not. If exists, can I be provided with some sample code on doing the same.

I now have a html textarea control and making use of third party jquery plugin for achieving the autosize functionality. Just want to replicate the same using Kendo UI.

Thx.
Alex Gyoshev
Telerik team
 answered on 21 Apr 2014
3 answers
1.0K+ views
How can I hide everything that is in the header above the calendar of the Scheduler control?  (Today, < >,  datepicker, Day, Week Month, Agenda)

I would also like to hide the footer that has the Show Business Hours.


Erik
Top achievements
Rank 1
 answered on 20 Apr 2014
7 answers
414 views
Hi ,

I am not able to bind or show the Multi Select  on  Kendo toolbar of Popup Editor(Under the Tab Grid)

Please find the demo here.

http://jsbin.com/kibidipo/6/edit

The Multi Select ID "multiselectfilter" is in Template.

End of the day I want to Show applied filter columns on Grid in a Multiselect as a buttons of filters applied on Grid by using Multiselect selected items.

Kindly let me know if I am in wrong direction or I am if I am not getting control values through use of Template properly.

Thanks,
Chatrapathi chennam
Chatra
Top achievements
Rank 1
 answered on 18 Apr 2014
1 answer
225 views
Hello,

is it possible to open the add/edit event view on a new page? We would like to avoid pop-ups in our application to prevent any user errors.

Thank you,

Jakub
Vladimir Iliev
Telerik team
 answered on 18 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
Application
Drag and Drop
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?