Telerik Forums
Kendo UI for jQuery Forum
0 answers
77 views
hi,

It is possible to use kendoAutoComplete in mobile application.

it is work or not

Thanks,
Raghwenda
Nick
Top achievements
Rank 1
 asked on 07 Aug 2012
0 answers
172 views
Hello,

I have an Editor Template in which only a DropDownList is present. I am trying to populate that DropDownList using an action on my controller. I have the following code:

@(Html.Kendo().DropDownListFor(m => m)
                .DataSource(
                    datasource => datasource
                        .Read(r => r.Action("GetPossibleLines", "ProductionProgram"))
                        .ServerFiltering(true)
                    )
                .DataTextField("Text")
                .DataValueField("Value")
                .HtmlAttributes(new { style = "width: 200px" }))

My action looks like this:

[HttpPost]
public ActionResult GetPossibleLines()
{
    var options =
        new List<SelectListItem>()
        {
            new SelectListItem() { Text = "LI50", Value = "51" }
        };
 
    return Json(options);
}

What am I doing wrong? The DropDownList doesn't get filled and keeps loading forever.
Max
Top achievements
Rank 1
 asked on 07 Aug 2012
0 answers
174 views
I have temporarily worked around this issue by flattening our data.  Now I am trying to let users edit a single field, however Kendo seems to be acting a little funny.

First, the system submits ALL fields in the model, whether they have changed or not.  This is bad on a number of accounts for us (auditing, repudiation, performance, etc.).  How do I tell Kendo to only submit the deltas?

Second, the additional fields it is submitting are being submitted as null.  Is this by design?  On the server, here is what we get for two values.  The first is a string I had provided as "null" and the other was just a NULL value that Kendo submitted.

Request.Form["String1"] == ""null""  (note the extra quotes, this is the string value of "null" quotes in included)
Request.Form["OtherValue"] == "null"  (note only in one set of quotes, because this is the string "null", with no quotes)

What is the best practice for submitting NULL values in Kendo?  Am I supposed to special case this on the server by pre-processing the Request.Form object?


Thanks!
rudy
Top achievements
Rank 1
 asked on 07 Aug 2012
1 answer
125 views
Hi,

Is there a way to have the kendoGrid editing popup window display only over the grid itself, that is, not cover the entire body of the document, but only cover the DIV element that has become the kendoGrid?

Thanks,

Dan
Daniel
Top achievements
Rank 1
 answered on 07 Aug 2012
0 answers
173 views
Can anyone point me to examples of the two overloads for the template column in a .cshtml file?
Tim
Top achievements
Rank 1
 asked on 06 Aug 2012
0 answers
166 views
We have a Kendo grid binding to a custom JSON model.  It looks something like this:

{
    id:  "{GUID}",
    name: "user",
    attributes:
    {
        firstname: "Joe",
        lastname: "Meadows"
     }
}

We are able to get this to bind to the grid using custom templates.  In addition, we are able to allow inline editing to work by configuring
the columnInfo "field" value to be "attributes.fieldname".

However, when we go to save the inline edits, the grid is again confused and is trying to write to the root object.  Example:

{
     id: "{GUID}"
     firstName: "Tony",

    ...
}

How can I get it to properly save my values into my .Attributes collection?

Thank you!
rudy
Top achievements
Rank 1
 asked on 06 Aug 2012
2 answers
526 views
I can recreate this with or without the MVC extensions, but im trying to solve it without but the sample is easier to demonstrate .

To the best of my understanding when kendo grid's datasource makes a request on (Update / Destroy / Create) and is successful (where the result responds status code ok) it will rebind the results (from the response) if presented to the grid.

The problem that I am having now is when it gets to this rebinding part. I created a quick demo using the kendo mvc (trial) to see if there was anything im missing but it ended up doing the same funny things.

Lets say the grid has three items.
{Data: [{Id : 1, Name: "item1"}, {Id: 2, Name: "item2"}, {Id : 3, Name: "item3"}] ... }

When the data is read from the server it is fine.
When the data is updated / created going to the server is fine as well as the new json coming back out of the server.
What happens next is a little odd.

Step1
Lets say I change "item1" to "bob" and click update then everything will look great and the grid will be updated as expected.
Step 2
Lets say I change any other item to "Tim" ... click update then the problem occurs. This row ends up appearing as the first item in the grid.
The obvious thing would be that it doesnt have the id part selected in the datasource which is why I retreated back to kendo mvc to test it correctly as getting the json incorrect is quite a easy thing to do.
(normally I would not have the id as a column, but the test is more relevant)
@(Html.Kendo().Grid<KendoMvcQuickTest.Models.Test>()   
    .Name("Grid")   
    .Columns(columns => {       
        columns.Bound(p => p.Id).Width(100);
        columns.Bound(p => p.Name);
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource       
        .Ajax()                
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.Id))
        .Create(update => update.Action("Create", "Grid"))
        .Read(read => read.Action("Read", "Grid"))
        .Update(update => update.Action("Update", "Grid"))
        .Destroy(update => update.Action("Destroy", "Grid"))
    )
)

The controller
public class GridController : Controller
    {
        public ActionResult Read([DataSourceRequest] DataSourceRequest request)
        {
            return Json(Data.ToDataSourceResult(request, ModelState));
        }
 
        public ActionResult Create([DataSourceRequest] DataSourceRequest request, Models.Test[] models)
        {
            foreach (var testItem in models)
            {
                testItem.Id = Data.Max(e => e.Id) + 1;
                this.Data.Add(testItem);
            }
 
            return Json(Data.ToDataSourceResult(request, ModelState));
        }
 
        public ActionResult Update([DataSourceRequest] DataSourceRequest request, Models.Test[] models)
        {
            foreach (var testItem in models)
            {
                var item = Data.FirstOrDefault(e => e.Id == testItem.Id);
                item.Name = testItem.Name;
            }
 
            return Json(Data.ToDataSourceResult(request, ModelState));
        }
 
        public ActionResult Destroy([DataSourceRequest] DataSourceRequest request, Models.Test[] models)
        {
            foreach (var testItem in models)
            {
                var item = Data.FirstOrDefault(e => e.Id == testItem.Id);
                Data.Remove(item);
            }
 
            return Json(Data.ToDataSourceResult(request, ModelState));
        }
 
        private Models.TestColleciton Data
        {
            get
            {
                return this.Session["TestCollection"] == null ?
                    (this.Session["TestCollection"] = Build()) as Models.TestColleciton :
                    (this.Session["TestCollection"]) as Models.TestColleciton;
            }
        }
 
 
        private Models.TestColleciton Build()
        {
            var collection = new Models.TestColleciton();
            collection.Add(new Models.Test() {
                Id = 1,
                Name = "item1"
            });
            collection.Add(new Models.Test()
            {
                Id = 2,
                Name = "item2"
            });
            collection.Add(new Models.Test()
            {
                Id = 3,
                Name = "item3"
            });
 
            return collection;
        }
    }


The JavaScript looks like:
<script>
    jQuery(function(){jQuery("#Grid").kendoGrid({columns:[{title:"Id",width:"100px",field:"Id",encoded:true,editor:"\u003cinput class=\"text-box single-line\" data-val=\"true\" data-val-number=\"The field Id must be a number.\" data-val-required=\"The Id field is required.\" id=\"Id\" name=\"Id\" type=\"number\" value=\"0\" /\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Id\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{title:"Name",field:"Name",encoded:true,editor:"\u003cinput class=\"text-box single-line\" id=\"Name\" name=\"Name\" type=\"text\" value=\"\" /\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Name\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{width:"200px",command:[{name:"edit",buttonType:"ImageAndText",text:"Edit"},{name:"destroy",buttonType:"ImageAndText",text:"Delete"}]}],pageable:{},sortable:true,editable:{confirmation:"Are you sure you want to delete this item?",mode:"inline"},toolbar:{command:[{name:null,buttonType:"ImageAndText",text:"Add new item"}]},dataSource:{transport:{read:{url:"/Grid/Read"},update:{url:"/Grid/Update"},create:{url:"/Grid/Create"},destroy:{url:"/Grid/Destroy"}},pageSize:10,page:1,total:0,serverPaging:true,serverSorting:true,serverFiltering:true,serverGrouping:true,serverAggregates:true,type:"aspnetmvc-ajax",filter:[],error:error_handler,schema:{data:"Data",total:"Total",errors:"Errors",model:{id:"Id",fields:{Id:{type:"number"},Name:{type:"string"}}}}}});});
</script>

Everything looks great so far.
Pre Step 1 - read:
{"Data":[{"Id":1,"Name":"item1"},{"Id":2,"Name":"item2"},{"Id":3,"Name":"item3"}],"Total":3,"AggregateResults":null,"Errors":null}
Step 1 - Update row where the Id is 1 to "bob"
Request Result
{"Data":[{"Id":1,"Name":"bob"},{"Id":2,"Name":"item2"},{"Id":3,"Name":"item3"}],"Total":3,"AggregateResults":null,"Errors":null}
Grid looks fine.
Step 2 - Update row where the id is 3 to "tim"
Request Result
{"Data":[{"Id":1,"Name":"bob"},{"Id":2,"Name":"item2"},{"Id":3,"Name":"tim"}],"Total":3,"AggregateResults":null,"Errors":null}
Now the grid looks a bit odd.
a newly updated row looks exactly like the first item. Both the id and name column on row 3 is exactly the same as row 1.

If the page/grid is refreshed then it looks as expected.
the version is: Kendo UI Complete v2012.2.710 (http://kendoui.com), which is from the Telerik Control Panel. Tested with the most recent internal build js files and the same problem.

If there is no json result then the grid is fine ie just give a response status code, but this causes problems to the 'created' items, as they wont know their relevant ids.

Is there something trivial that I'm missing here? I'm fairly sure I've had this simple functionality working before, but might be just having one of those days.

Thanks to anyone able to help.

Matt
Matthew
Top achievements
Rank 1
 answered on 06 Aug 2012
0 answers
57 views
I have a grid Update event that passes (e) to the function and I'm sure I should be able get the cell by field name but I'm not sure how. I want to change the css of the cell once I get it like I am here:
  $('tr[data-uid="' + row.uid + '"] td:nth-child(1)').css("background-color""Pink"); 

I can see in Firebug (attached file has screenshot) that the cells are included in (e), the one I'm
trying to get is named PO_ID.
AkAlan
Top achievements
Rank 2
 asked on 06 Aug 2012
0 answers
59 views
I have a grid Update event that passes (e) to the function and I'm sure I should be able get the cell by field name but I'm not sure how. I want to change the css of the cell once I get it like I am here:
  $('tr[data-uid="' + row.uid + '"] td:nth-child(1)').css("background-color""Pink"); 

I can see in Firebug (attached file has screenshot) that the cells are included in (e), the one I'm
trying to get is named PO_ID.
AkAlan
Top achievements
Rank 2
 asked on 06 Aug 2012
0 answers
262 views
I plan to create an ASP.NET MVC3 based website, that uses EF 5.0 for database access, built using VS2012 and .NET 4.5.

A couple questions please-

1. Is Kendo UI the best choice for an ASP.NET MVC3 website that must run on IE7 and works with .NET 4.5?
2. Is there a decent wireframe or website mocking tool that I can from within VS2012 that will later work with Kendo UI?

Thanks, Dave

Dave
Top achievements
Rank 1
 asked on 06 Aug 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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?