Telerik Forums
Kendo UI for jQuery Forum
2 answers
229 views
I am trying to set up a datasource with the code at the end of the post but the data isn't sent to the server (xmlstring is a string of the xml to be included as the body)  I always get content length zero.
Is it possible to send an xml string as the body of a POST?  I do this from desktop applications and Flash (actionscript) in a similar way but can't seem to get any results with Kendo.  Any help would be appreciated.  

As am FYI this works but I'm guessing I can't do this with the Kendo datasource (  $.ajax({
				    type: 'POST',
				    url: "http://rest.site.comm/rest/isc/packagecontents",
				    data: xmlstring,
				    dataType: "xml")

Thanks,
Jeff

  var dataSource = new kendo.data.DataSource({
                        transport: {
                        read: {
                        type: "POST",
                            // specify the XML file to read. The same as read: { url: "books.xml" }
                          url: "http:/rest.site.com/rest/isc/packagecontents/" ,   
                            dataType: "xml", 
                           data: xmlstring
                        } 
Jonathan
Top achievements
Rank 1
 answered on 18 Jul 2012
0 answers
150 views
I was having trouble finding a dataSource example for CRUD against a REST based xml service.  I found pieces of the following solution in various posts. Some of this is obvious, but some is not, especially to someone new to kendo and/or jquery.  In case anyone else is looking for something similar, I thought I would post the following example.  This configures a datasource to create/read from an xml REST service using GET for read and PUT for create with an xml document as the payload.  If anyone else has a better solution than the parameterMap to send an xml doc in the payload, please let me know.  Hope this saves someone a headache :)

ds = new kendo.data.dataSource({
transport:{
read: {
url: "/apis/items"
},
create: {
url: "/apis/items/create",
// in another thread, a kendo admin posted that these transport
// apis map to $.ajax, so we can directly add most jquery.ajax options here
type: "PUT",
dataType: "xml",
contentType: "text/xml",
// Must set processData to false if you want to send
// raw data in the request body, see the jquery documentation for more info
processData: false,
},
parameterMap: function (data, type){
// You can pre-process data by mapping a function
// with these parameters to this property.  The first param is in
// the kendo online documentation, the second is not.

if(type === "create"){
return '<item><name>' + data.name + '</name></item>';
}
}
},
schema: {
type: "xml",
data: "/items/item",
model: {
id: "id",
fields: {
id: "@id",
name: "name/text()"
}
}
},
pageSize:10
});

// Now you can add by passing a model w/o the id property to dataSource.add()
ds.add({name: "test"});

// Calling ds.sync() will issue the server request we defined in transport.create to the server.
// the payload will contain <item><name>test</name></item>
ds.sync();

// Hope this helps.  
Jonathan
Top achievements
Rank 1
 asked on 18 Jul 2012
1 answer
110 views
I found the awesome chart like 'Performance Benchmark' : url(http://demos.kendoui.com/dataviz/dashboards/high-performance.html).
but i can't find how to bind a data and to make an active chart. i want to know both logic (data binding, active real time chart).
Hristo Germanov
Telerik team
 answered on 18 Jul 2012
3 answers
133 views
I have a very peculiar problem. One of my client requests goes to the HomeController and successfully gets the data. The second never gets reached

$("#ResidualRec") 

What could be wrong? 


$("#Accounts").kendoComboBox({
               dataTextField: "AcctName",
               dataValueField: "AcctCd",
               dataSource: {
                   transport: {
                       read: "/Home/GetAccounts"
                   }
               },
               template: $("#scriptTemplate").html(),
               filter: "startswith"
           });
 
           var combobox = $("#Accounts").data("kendoComboBox");
           // set width of the drop-down list
           combobox.list.width(400);
 
           var sharableDataSource = new kendo.data.DataSource({
               transport: {
                   read: {
                       url: "@Url.Action("GetSecurities","Home")",
                       dataType: "json"   
                   },
                   type:"POST"
               }
           });
 
           $("#ResidualRec").kendoComboBox({
               datasource:sharableDataSource,
               filter: "startswith"
           });
This is the webpage value.
<select id="ResidualSec"  data-value-field="Cusip" data-text-field="SecName" data-role="combobox" placeholder="Enter Residual" data-bind="value: Residual"></select>                   
            <select id="UnderlyingSec" data-role="combobox" data-value-field="SecName" data-text-field="Cusip" placeholder="Enter Underlying" data-bind="value: Underlying"></select>
            <select id="FloaterSec" data-role="combobox" data-text-field="SecName" data-value-field="CUSIP" placeholder="Enter Floater" data-bind="value: Floater"></select>

The one that works is as follows: 
<div id="allocation">
    <div class="selector">         
   <select id="Accounts" style="width: 225px" data-role="combobox" data-value-field="AcctCd" data-text-field="AcctName"
                data-bind="value: AcctCd" placeholder="Select Funds..."></select>

Iliana Dyankova
Telerik team
 answered on 18 Jul 2012
1 answer
83 views
Hello,

i have a little problem here.

I have a column with this time format: 27.12.2012 14:49

When somebody wants to group it it should only grouped by date but without time.

How can I implement this?

Thanks.

Greetings
Stefan
Atanas Korchev
Telerik team
 answered on 18 Jul 2012
6 answers
427 views
I've created a multi select template that allows for selection of values in a combobox. How can you prevent the combobox from closing when you select? Is there a close override event?
Georgi Krustev
Telerik team
 answered on 18 Jul 2012
1 answer
78 views
We are developing a mobile app for which we plan to use phonegap.com to generate a native application for iOS and Android (and others). Other than the mobile controls, what other Kendo UI controls are compatible with PhoneGap/native applications? Specifically, what can we use from the Kendo Web and Kendo DataViz controls? What is the result if you attempt to use an unsupported control and compile using phonegap?
Atanas Korchev
Telerik team
 answered on 18 Jul 2012
1 answer
305 views
Hi, Can I get an example that actually post json object/json string as parameter in the request body please?
I did went through the forum, couldn't find one example, the nearest is someone want to send raw xml through request body, but no futher discussion about that exacept suggesting extending object rather than string. 
the other one I saw was using paramMap send empty request body.

there is no such example in your website, the example is used to send parameters in simple query string which is not json as request body.

And may I just suggest that can you focus more on the documentation please? the documentation has no possible values for configurations. leaving people to guess.

I think good documentation is a huge time saver for everyone. 
Robin
Top achievements
Rank 1
 answered on 18 Jul 2012
1 answer
136 views
For the life of me, I can not figure out why this is happening.

Below I have a pretty simple grid wired to a Read and a Destroy event.  The Read works.  If I press delete and then save the grid the wrong webservice is called.

If batch editing it turned on then when I press save the READ event is called (instead of the Destroy event). And I get the error that I can't stuff an enumeriable list of objects into the ID field of the Read service.

If batch editing is turned off then the CREATE event is called! And since I haven't created one I get a 404.

That's weird man.  Any ideas?

$("#JobAttachments").kendoGrid({
    columns: [
                { title: "Filename", template: "<a href='../UploadedFiles/${ SavedFileName }'>${ OriginalFileName }</a>", width: "250px" },
                { field: "EnterBy", title: "Uploaded By", width: "200px"},
                { command: "destroy", title: "Delete", width: "100px" }
            ],
    toolbar: ["save", "cancel"], // specify toolbar commands
    editable: true, // enable editing
    dataSource: {
        schema: {
            data: "d", // ASMX services return JSON in the following format { "d": <result> }. Specify how to get the result.
            model: { // define the model of the data source. Required for validation and property types.
                id: "JobTaskId",
                fields: {
                    AttachmentID: { editable: false, nullable: false },
                    JobId: { editable: false, nullable: false },
                    OriginalFileName: { editable: false },
                    SavedFileName: { editable: false },
                    AttachmentType: {  },
                    Notes: { },
                    EnterBy: {}
                    //,
                    //EnterDate: { type: "date"}
                }
            }
        },
        batch: false, // enable batch editing - changes will be saved when the user clicks the "Save changes" button
        transport: {
            create: {
                url: "../WebServices/JobAttachmentWebservice.asmx/NotUsed",
                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
            },
            read: {
                url: "../WebServices/JobAttachmentWebservice.asmx/Read",
                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
            },
            update: {
                url: "../WebServices/JobAttachmentWebservice.asmx/Update",
                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
            },
            destroy: {
                url: "../WebServices/JobAttachmentWebservice.asmx/Delete",
                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
            },
            parameterMap: function (data, operation) {
                if (operation != "read") {
                    // web service method parameters need to be send as JSON. The Create, Update and Destroy methods have a "products" parameter.
                    return JSON.stringify({ jobView: data.models })
                }
                else {
                    return JSON.stringify({ JobId: currentJobId })
                }
            }
        }
    }
});
Laura
Top achievements
Rank 1
 answered on 18 Jul 2012
3 answers
485 views
I only want users to be able to leave my autocomplete field empty, or select an item from the list - I don't want them able to enter their own "new" item. How can I force a valid selection (either by clearing the invalid data, or not allowing the focus to leave the control, or some other variation)?
Dimo
Telerik team
 answered on 18 Jul 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
Application
Map
Drag and Drop
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?