Telerik Forums
Kendo UI for jQuery Forum
3 answers
503 views
I'm having trouble calling the update method exposed as a JSON endpoint by a .NET WCF domain service. I think the domain service is set up correctly because the read method is working fine - I can get data into the bound kendoGrid very nicely. But I can't seem to post any data to the domain service via the update method.

Fiddler shows the following when I try to update a record in the kendoGrid...
GET http://localhost:3223/DataServices/Application-myDomainService.svc/JSON/UpdateDATA?AUTOID=1&CODE1=code1&CODE2=code2 HTTP/1.1
Host: localhost:3223
Connection: keep-alive
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.83 Safari/535.11
Accept: application/json, text/javascript, */*; q=0.01
Referer: http://localhost:3223/Pages/Home.aspx
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: ASP.NET_SessionId=dl1a5qkkzbsaur0o5qlhuvhf

Does this mean that it's using a GET method to call the update endpoint rather than a POST? The response is a 404 error with message "Endpoint not found."

Any help here?
Michael
Top achievements
Rank 1
 answered on 24 Apr 2012
11 answers
551 views
I've just tried to convert my original ViewModel to a Kendo-based viewmodel, in hopes I'd be able to use this model to pick up functions from my custom template assigned to a Grid. This, however, doesn't seem to be the case.

Right now I have:

<script id="gridTemplate" type="text/x-kendo-template">
         <span class="k-icon k-arrow-next cursor detailLink" cId="#= ContactID #" data-bind="click: doSomething"></span>
</script>

With the template assigned to my Grid, and doSomething as a function within my Kendo ViewModel. The Grid only gets loaded when a user presses a button on the page, which may have something to do with it - but if it has, then it takes out the point of a View Model always being active.

Is this a known issue in the beta?
Luc
Top achievements
Rank 1
 answered on 24 Apr 2012
1 answer
261 views
Problem reproduced at http://jsfiddle.net/MenYM/12/

I am using a drop down list, with following bindings to a view model:
1. source (simple array of items)
2. value 

I have also defined the data-role and, perhaps most importantly for this query, a data-option-label.

The problem is that if the data source defined in the view model is defined as an empty array, and at some point the data source is modified, the drop down list has an empty element, even before the data-option-label. (See the jsfiddle linked above).

On the other hand, if the data source had an element and afterwards was modified in the same way, the drop down list does not have an empty element.

What could be the problem here? Any pointers are appreciated.

Thanks,
Siddhartha Agrawal
Georgi Krustev
Telerik team
 answered on 24 Apr 2012
6 answers
783 views
Does anyone have an example of a controller method that will get the success event to fire? I keep getting the unexpected result error. 

My current controller method looks like this. I have tried many different results and nothing seems to work.
        [Authorize]
        [HttpPost]
        public String AddFile(int Id, IEnumerable<HttpPostedFileBase> attachments)
        {
            
            Response.ContentType = "text/plain"; 
            return   @"{""status"": 0, ""data"": [{""DocumentId"": ""5""}]}"; 
 
        }


        $("#attachments").kendoUpload({
            async: {
                saveUrl: saveURL,
                removeUrl: removeURL,
                autoUpload: true
            },
            upload: attachOnUpload,
            success: attachOnSuccess,
            error: attachOnError
        });


function attachOnUpload(e) {
 
        e.data = { Id: '@Model.Id' }
 
    }
 
    function attachOnSuccess(e) {
         
        var hiddenField = $("#DocumentId");
        hiddenField.val(e.DocumentId);
        
 
    }
    function attachOnError(e) {
        debugger;
	//always fires no matter what is returned from controller

    }
James
Top achievements
Rank 1
 answered on 24 Apr 2012
2 answers
266 views
Hi,

I have a data-show function which loads up my listview tempate from a simple "data_testing_list" function which builds and returns a local array.

Now when I return to this view after first load, the listview has all nulls, so I "assume" (not sure) I cannot just re-create it using

$("#testing_listview").kendoMobileListView({ ...


for some reason (if so, could someone explain why this is so? as it seems a simple way to reload it?),

Could someone tell me the best practice for setting up this listview (I assume in .ready) and then reloading its data on subsequent shows?

function testing_show() {

$("#testing_listview").kendoMobileListView({

dataSource: kendo.data.DataSource.create({ data: data_testing_list(), group: "letter" }),

template: $("#testing_listview_template").html(),

headerTemplate: "${value}"

});

}

Thanks for your help
Matt

Matt
Top achievements
Rank 1
 answered on 24 Apr 2012
2 answers
468 views
How do I enable sorting on a grid when using a row template.

For example I took the "Row Template" demo and added "sortable: true", but this did not work.  Is there an additional step I am missing?

Here is what I tried:

<script>
                $(document).ready(function () {
                    $("#netflixTable").kendoGrid({
                        dataSource: {
                            type: "odata",
                            serverFiltering: true,
                            filter: [{
                                field: "Name",
                                operator: "contains",
                                value: "Star Wars"
                            }, {
                                field: "BoxArt.SmallUrl",
                                operator: "neq",
                                value: null
                            }],
                            transport: {
                                read: "http://odata.netflix.com/Catalog/Titles"
                            }
                        },
                        sortable: true,
                        rowTemplate: kendo.template($("#rowTemplate").html()),
                        height: 200
                    });
                });
            </script>


Less important: how can I add the alternating row backgrounde effect when using a row template?
Kjell
Top achievements
Rank 1
 answered on 24 Apr 2012
8 answers
543 views
For some weird reason the select event is not fired when i click on the results. Did the following :
 var autoComplete = $("#autoComplete").kendoAutoComplete({
  dataTextField: "name",
select : function(e) { console.log(e); }
...

});
but no joy. Also, i tried binding it afterwards like it suggests on the manual but nothing.
Finally i did the following : 

 autoComplete.popup.element.bind("click", function(e) {
   var index = $(e.currentTarget).index();
   var dataItem = autoComplete.dataSource.view()[index];
    
   console.log(dataItem);
});

but this is a hack job and i would much rather not use it
Brandon
Telerik team
 answered on 24 Apr 2012
1 answer
170 views
Hello,

I found out two bugs in kendo slider,
The first one is when you enable an slider which is enable the slider become crazy. When you go up and after go down two or three times, Slider does what it wants. You have to do sometimes a lot of clicks, sometimes a few clicks, but normally you have a click and it increase the value slider and that is not a good behavior.

The second one is when a slider is disable and you want to move the "circle" (drag and drop to change value slider) that raise too many errors.

<input id="slider" class="balSlider" />
            <script>
 
            $(document).ready(function(){
                $("#slider").kendoSlider({
                                increaseButtonTitle: "Right",
                                decreaseButtonTitle: "Left",
                                min: 0,
                                max: 10,
                                value: 1,
                                smallStep: 1,
                                largeStep: 1,
                                tickPlacement:"both"
                            }).data("kendoSlider");
 
                var slider = $("#slider").data("kendoSlider");
 
                slider.enable();
            });
 
 
            </script>
Hristo Germanov
Telerik team
 answered on 24 Apr 2012
0 answers
203 views
I got this "string" column first_name, which seems to be validated (it doesn't even have a validation rule specified) in a grid.
When i open the edit popup and change it's value, i get a validation message: "first_name is not valid date"..
This does not happen if i remove the column birthdate or set it's type to be "string"...
In fact.. if i fill a valid date into first_name, and some random string into birthdate, it doesn't complain anymore.. so it seems that even tho birthdate is displayed as a datepicker, it tries to validate first_name.
This also only happens when the editable attribute is set to 'popup' and works with inline editing.
I am pretty amazed at how this can be possible. please help!!!

Code:
$(document).ready(function () {
    var crudServiceBaseUrl = '/participant',
    dataSource = source,
        batch: true,
        pageSize: 30,
        schema: {
            model: {
                id: "id",
                fields: {"id":{"editable":false,"type":"number","label":"ID"},"first_name":{"type":"string","label":"First Name"},"last_name":{"type":"string","label":"Last Name"},"birthdate":{"type":"date","label":"Birthdate"},"social_security_number":{"type":"string","label":"Social Security Number"},"smoker":{"type":"boolean","label":"Smoker"},"vegetarian":{"type":"boolean","label":"Vegetarian"},"miscelaneous":{"type":"string","label":"Miscelaneous"},"active":{"type":"boolean","label":"Active"},"blacklist_comment":{"type":"string","label":"Blacklist Comment"}}            }
        }
    });
 
    $("#grid").kendoGrid({
        dataSource: dataSource,
        width: 1000,
        toolbar: ["create"],
        columns: [{"title":"ID","field":"id"},{"title":"First Name","field":"first_name"},{"title":"Last Name","field":"last_name"},{"title":"Birthdate","field":"birthdate"},{"title":"Social Security Number","field":"social_security_number"},{"title":"Smoker","field":"smoker"},{"title":"Vegetarian","field":"vegetarian"},{"title":"Miscelaneous","field":"miscelaneous"},{"title":"Active","field":"active"},{"title":"Blacklist Comment","field":"blacklist_comment"},{"command":"destroy","filterable":false},{"command":"edit","filterable":false}],
        editable: "popup",
        selectable: "row",
        pageable: true,
        sortable: true,
        groupable: true,
        filterable: true,
    });
});
GungFooMon
Top achievements
Rank 1
 asked on 24 Apr 2012
0 answers
148 views
Hello,

I want to create a grid with a hierarchy. I have clients who have differents missions.
I want to class by mission (number) and have informations about this mission. Informations are in my function "Tableau" and return on json list and contains the mission code.
I pass in parameters a which is a list which contains the missions (differents numbers missions).


function createGridMission(a)
{
 
    var element = $("#gridF01").kendoGrid({
                    dataSource: {
                            data: a,
 
                        pageSize: 6,
                        serverPaging: true,
                        serverSorting: true
                    },
                    height: 450,
                    sortable: true,
                    pageable: true,
                    detailInit: detailInit,
 
                    columns: [
                        {
                            field: "mission",
                            title: "Mission"
                        }
                             ]
                });
 
 
            function detailInit(e) {
                $("<div/>").appendTo(e.detailCell).kendoGrid({
                    dataSource: {
                        transport: {
                            read: {
                                url: "/Mob/Client/Tableau?mission=" + a + "&id=" + $("#hidCodeClient").val(),
                                dataType: "json"
                            }
                        },
                        serverPaging: true,
                        serverSorting: true,
                        serverFiltering: true,
                        pageSize:6,
                        filter: { field: "mission", operator: "eq", value: e.data.mission }
                    },
                    scrollable: false,
                    sortable: true,
                    pageable: true,
                    columns: [
                            { field:"periode", title:"Période" },
                            { field:"debut", title:"Début" },
                            { field:"fin", title:"Fin" },
                            { field: "quantite", title:"Quantité" },
                            { field:"production", title:"Production" },
                            { field:"facturation", title:"Facturation" },
                            { field:"solde", title:"Solde" },
                            { field:"dateSolde", title:"Date solde" }
                        ]
                });
 
    }
 
}
Florian
Top achievements
Rank 1
 asked on 24 Apr 2012
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
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?