Telerik Forums
Kendo UI for jQuery Forum
2 answers
214 views

http://jsfiddle.net/OnaBai/5x8wt0f7/

What am I supposed to do  if my data is

data: [
            { proccess: "p1", estatus: 1, ob:{comment: "c1"} },
            { proccess: "p2", status: 2,  ob:{comment: "c1"} },
            { proccess: "p3", status: 3,  ob:{comment: "c1"} },
        ],

 

wanted to get the same result as in fiddler

Aditya
Top achievements
Rank 1
 answered on 15 Apr 2015
3 answers
310 views

When doing Update/Create/Destory operations, two operations get posted to the controller:

First Create operation then a Destroy/Update/Create.

And the ModelState is invalid always.

I have code:

 Client side grid:

            <script>
                $(document).ready(function () {
                    var crudServiceBaseUrl = "",
                        dataSource = new kendo.data.DataSource({
                            transport: {
                                read: {
                                    url: crudServiceBaseUrl + "/Users/Read",
                                    dataType: "json"
                                },
                                update: {
                                    url: crudServiceBaseUrl + "/Users/Edit",
                                    type: "POST",
                                    dataType: "json"
                                },
                                destroy: {
                                    url: crudServiceBaseUrl + "/Users/Destroy",
                                    type: "POST",
                                    dataType: "json"
                                },
                                create: {
                                    url: crudServiceBaseUrl + "/Users/Create",
                                    type: "POST",
                                    dataType: "json"
                                },
                                parameterMap: function (options, operation) {
                                    if (operation !== "read" && options.models) {
                                        return { models: kendo.stringify(options.models) };
                                    }
                                }
                            },
                            batch: true,
                            pageSize: 20,
                            schema: {
                                data: "Data",
                                model: {
                                    id: "ID",
                                    fields: {
                                        ID: { type: "number" },
                                        FirstName: { type: "string" },
                                        LastName: { type: "string" },
                                        Email: { type: "string" },
                                        Password: { type: "string" }
                                    }
                                }
                            }
                        });

                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 550,
                        toolbar: ["create"],
                        columns: [
                            { field: "FirstName", title: "First Name" },
                            { field: "LastName", title: "Last Name" },
                            { field: "Email", title: "Email" },
                            { field: "Password", title: "Password" },
                            { command: ["edit", "destroy"], title: "&nbsp;", width: "250px" }],
                        editable: "inline"
                    });
                });
            </script>

Controller:

        public ActionResult Read([DataSourceRequest] DataSourceRequest request)
        {
            var users = db.Users.Select<DAL.User, UserViewModel>(u => new UserViewModel
                {
                    ID = u.ID,
                    FirstName = u.FirstName,
                    LastName = u.LastName,
                    Email = u.Email,
                    Password = u.Password
                });

            return this.Json(users.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Edit([DataSourceRequest] DataSourceRequest request, UserViewModel user)
        {
            if (user != null && ModelState.IsValid)
            {
                var userToUpdate = db.Users.FirstOrDefault<DAL.User>(u => u.ID == user.ID);
                if (userToUpdate != null)
                {
                    userToUpdate.FirstName = user.FirstName;
                    userToUpdate.LastName = user.LastName;
                    userToUpdate.Email = user.Email;
                    userToUpdate.Password = user.Password;

                    db.SaveChanges();
                }
            }

            return Json(new[] { user }.ToDataSourceResult(request, ModelState));
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Create([DataSourceRequest] DataSourceRequest request, UserViewModel user)
        {
            if (user != null && ModelState.IsValid)
            {
                var userToCreate = new DAL.User();
                userToCreate.FirstName = user.FirstName;
                userToCreate.LastName = user.LastName;
                userToCreate.Email = user.Email;
                userToCreate.Password = user.Password;
                db.Users.Add(userToCreate);

                db.SaveChanges();
            }

            return Json(new[] { user }.ToDataSourceResult(request, ModelState));
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Destroy([DataSourceRequest] DataSourceRequest request, UserViewModel user)
        {
            if (user != null && ModelState.IsValid)
            {
                var userToDelete = db.Users.FirstOrDefault<DAL.User>(u => u.ID == user.ID);
                if (userToDelete != null)
                    db.Users.Remove(userToDelete);

                db.SaveChanges();
            }

            return Json(new[] { user }.ToDataSourceResult(request, ModelState));
        }

        // GET: Users
        public ActionResult Index()
        {
            return View();
        }

Alexander Valchev
Telerik team
 answered on 15 Apr 2015
1 answer
285 views

Is it possible to set the theme on a grid without changing the entire css? For example I can have several graphs all on the same page with different themes, that can be set dynamically. Is there a way to set the theme on an instance of a grid like you can with graphs?

 

Thanks

Dimo
Telerik team
 answered on 15 Apr 2015
1 answer
920 views

I'm trying to use a custom footer in the KendoUI DatePicker, I'm able to do this, however it's always wrapped in the today link. For example:

 

<a href="#" class="k-link k-nav-today" title="Monday, April 13, 2015">
    ... My Custom Footer Code ...
</a>

Is there a way to prevent my footer code from being wrapped in the link?

Alexander Popov
Telerik team
 answered on 15 Apr 2015
7 answers
396 views
Hi there

New to Kendo

Hoping for some direction here. When i use the following code i keep getting a 401 error. The username and password are correct
var dataSource = new kendo.data.DataSource({
                  autoSync: true,
                    
                  transport: {
                    read:  {
                        url: "web service url",
                        beforeSend: function (xhr) {
                //your code
                            xhr.setRequestHeader("Authorization", "Basic username:password"); //i set the username and password to valid settings
            },
                      dataType: "jsonp" // "jsonp" is required for cross-domain requests; use "json" for same-domain requests
                    },
                    update: {
                      url: "web service url",
                      dataType: "jsonp" // "jsonp" is required for cross-domain requests; use "json" for same-domain requests
                    }
                  },
                  schema: {
                    model: { id: "Id" }
                  }
});


If i use eclipse and build an android app i can set the username and password properties of the DefaultHttpClient and i can connect successfully, so it appears the service works (I can also access it via a browser which prompts for credentials and i get the data)

any ideas ??

Steve Gray
Top achievements
Rank 1
 answered on 15 Apr 2015
5 answers
2.7K+ views
I know this question has been asked before, however, I didn't see a good answer for it.  Basically, I want my  tab to fire ajax call to get fresh content every time the tab is changed, not just the first time. Is there a configuration or recommended way that I can achieve this?

Jianwei
Josh
Top achievements
Rank 1
 answered on 15 Apr 2015
1 answer
201 views

 Incorrect visualization, how can I fix it?

 http://dojo.telerik.com/ejUrO

 

Thanks for the help

Kiril Nikolov
Telerik team
 answered on 15 Apr 2015
3 answers
212 views

I have two separate scenarios.  In both scenarios the treeview is 2 levels deep.

 Level 1A

     -Level 2a

     -Level 2b

Leve l 1B

 

I have hacked together some jquery but it is ugly and  I was wondering if there is an efficient way to in one case limit selections to top (parent) level nodes (Level 1A, Level 1B) and in the other case limit selections to child level nodes (Level 2a, Level 2b).  Maybe someway in the template to add a class to child level nodes or something of that sorts?

Martez
Top achievements
Rank 1
 answered on 15 Apr 2015
6 answers
530 views
I was handling the requestEnd event of the DataSource, but it doesn't contain information about errors: 
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-requestEnd

Is it possible to add error information to the event parameter? similar to what we have on http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-error


Kiril Nikolov
Telerik team
 answered on 15 Apr 2015
3 answers
107 views
Hi Kendo team,
Export to excel exports neither grid themes nor cell styles. It's really a datasource export without stylesheet. Many companies apply their brand theme to their excel files.
How can it be accomplished with kendo ui?
Kind regards,
Oscar.
Kiril Nikolov
Telerik team
 answered on 15 Apr 2015
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?