Telerik Forums
Kendo UI for jQuery Forum
1 answer
167 views



I can not set viewbag.x to datasource property of kendoAutoComplete.

var friends = "@ViewBag.Friends2";
var friends2 = $('<div/>').html(friends).html();


$.each(friends2, function (key, value)
{
$("#pResult").append(key.Name +" " + value.Name);
});

when I try change the datasource viewbag to other ,it worked.
Burke
Top achievements
Rank 1
 answered on 30 Nov 2012
1 answer
110 views
Hi,
I have DateTimePicker on the page but it ignores any  format configuration settings on first render.
This code:
$("#absStart").kendoDateTimePicker({format: "dd-MM-yyyy HH:mm", timeFormat:"HH:mm" }); 
renders:
11/1/2012 2:20:00 PM
After selecting date or time everything is ok
I forgot something?
jr

Georgi Krustev
Telerik team
 answered on 30 Nov 2012
1 answer
158 views
I would like to display both description and Date in my kendo auto complete. THe following code will display as expected except the date. The date is displaying weird format 


if i type Nike

xml schmea
<d:SDate  m:type="Edm.DateTime">2012-11-21T18:30:51.097</d:SDate>
it will come up Nike (/Date(13534560000)/)    


 $("#titles").kendoAutoComplete({
                minLength: 3,
                dataTextField: "SDesc",
                dataValueField: "RefID",
                template: '${ data.SDesc } ' + '(' + '<span>${ data.SDate }</span>' + ')',
                                 
                dataSource: {
                    type: "odata",
                    serverFiltering: true,
                    serverPaging: true,
                    pageSize: 20,
                    transport: {
                        read: "http://localhost:54329/HH_WcfDataService.svc/Product"
                    }
                }
            });
Burke
Top achievements
Rank 1
 answered on 30 Nov 2012
1 answer
117 views
Hi,


It is possible to use autocomplete with style tags? So how is Facebook or gmail when selecting the recipients e-mail?


Example: http://www.webresourcesdepot.com/dynamic-form-autocomplete-facebook-style/






Sorry for my bad English
Burke
Top achievements
Rank 1
 answered on 30 Nov 2012
1 answer
58 views
Hello ..
need some help before my brain explodes..
cant seem to understand what im doing wrong

have a quite simple autocomplete.

$(document).ready(function () {
 
var data =new kendo.data.DataSource({
        serverFiltering: true,
        transport: {
            read: "data/output.txt" 
        }
    });
  $("#input").kendoAutoComplete({
            dataSource: data
      });
        });
But no matter how hard i try i dont get the result i want, just the list with one letter vertical..?
I dont know how am the external file supposed to look? as now it just is:
"value1",
"value2",
"value3"

Burke
Top achievements
Rank 1
 answered on 30 Nov 2012
1 answer
183 views
I am not sure how I should map this data to get it to the datasource. I have read the docs but am not sure how to map this data.  If I change the url back to the demo.kedoui.com/service the data: event fires and binds ok.  With my url I get error event with msg error, but I do not see any data returned or how to fix this so the data is mapped correctly and the data event fires using my url json service.

Thanks

Data:
{"__entityModel":"People","__COUNT":3,"__SENT":3,"__FIRST":0,"__ENTITIES":[{"__KEY":"27","__STAMP":11,"ID":27,"firstName":"dan","lastName":"qqqq"},{"__KEY":"26","__STAMP":14,"ID":26,"firstName":"dan","lastName":"rrrr"},{"__KEY":"25","__STAMP":13,"ID":25,"firstName":"dan","lastName":"eeee"}]}
Code:
   $(document).ready(function () {
                   //var crudServiceBaseUrl = "http://demos.kendoui.com/service",
                  //  var crudServiceBaseUrl = "http://127.0.0.1:8081/rest",
var dataSource = new kendo.data.DataSource({
        transport: {
            read: {
                url: "http://127.0.0.1:8081/rest/People",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                dataType: "json"
            }
        },
        schema: {
            data: function (data) {
                alert("got data")
                alert(data);   /*Data Return Successfully*/
                return data;
            }
        },
        error: function (e) {
            debugger;
            alert("Error");
        },
        change: function (e) {
            alert("Change");
        },
        requestStart: function (e) {
            debugger;
            alert("Request Start");
        }
    });
 
                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 400,
                        toolbar: ["create"],
                        columns: [
                            "firstName",
                               "lastName",
                            { command: ["edit", "destroy"], title: " ", width: "210px" }],
                        editable: "inline"
                    });
                });
Christopher Tallos
Top achievements
Rank 1
 answered on 30 Nov 2012
1 answer
120 views
Is there away to either bind a ButtonGroup to a model or programmatically modify it's collection?

Thanks,

Bron
Iliana Dyankova
Telerik team
 answered on 30 Nov 2012
1 answer
364 views
Hi,

I am using the Kendo Grid with the MVC helpers, and want to make a conditional area in ClientRowTemplate.
Currently I have the following ClientRowTemplate:
.ClientRowTemplate("<tr>" +
                       "<td >" + 
                           "${ FirstName} " +
                       "</td>" +
                       "<td> " +
                           "${ LastName} " +
                       " </td>" +
                   "</tr>" +
                   "${optionalNotes(Notes)}")
and this JavaScript:    
function optionalNotes(t) {
    if (t.length > 0) {
        return "<tr><td colspan='2'>" + t + "</td></tr>";
    } else {
        return "";
    }
}
This works partially. My JavaScript is being fired, but the result is escaped before it is being added into the grid. So, instead of getting an optional tablerow with Notes, I get the html displayed.
Is there any way to indicate to Kendo to treat the JavaScript output as raw HTML in this context?
Thanks,
Ewald
Petur Subev
Telerik team
 answered on 30 Nov 2012
1 answer
180 views
How to add multiple check boxes in Kendo grid column. I am using trial version of kendo grid in SharePoint.

Please advice.
Atanas Korchev
Telerik team
 answered on 30 Nov 2012
1 answer
136 views
How do I send the object constructed using kendo.data.Model back to ASP.MVC?

For example, a person object is create using the kendo.data.Model using the code below
var Person = kendo.data.Model.define( {
    id: "personId", // the identifier of the model
    fields: {
        "name": {
            type: "string"
        },
        "age": {
            type: "number"
        }
    }
});
 
var person = new Person( {
    name: "John Doe",
    age: 42
});
My first question - How do I use a $.Ajax() to send the object back to my ASP MVC action (e.g AddPerson)?
function addPerson(person) {
    $.ajax({                   
        url: "/Person/Add/"
    });
}

My second question - How do i bind the receive model on the server side code?
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Add([DataSourceRequest] DataSourceRequest request, Person person)
{
    // Code to add person to database.
}

Petur Subev
Telerik team
 answered on 30 Nov 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Collapsible
Localization
MultiViewCalendar
Touch
Breadcrumb
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?