Telerik Forums
Kendo UI for jQuery Forum
2 answers
255 views

How can I change the fields that display for an Add/Update? For an add I need to have 4 fields display and for an edit I need to only display 2. I tried creating a template usercontrol but it is showing up for both an add/update. I tried modifying the viewmodel and that is applying the changes to both the add/update also.

Grid:

@(Html.Kendo().Grid(Model)
        .Name("CodeManager")
    .Columns(columns =>
    {       
        columns.Bound(p => p.CodeID);
        columns.Bound(p => p.Status);
        columns.Command(command => { command.Edit(); }).Width(200);
     
    })
    .ToolBar(toolBar => toolBar.Create())
    .Editable(editable => editable.Mode(GridEditMode.PopUp)) 
    .Sortable()
    .Scrollable()
    .Groupable()
    .Pageable()
    .Filterable()
    .DataSource(dataSource => dataSource   
        .Ajax()
        .Events(events => events.Error("error_handler"))
        .ServerOperation(false)
            .Model(model =>
            {
                model.Id(p => p.CodeID);
                model.Field(p => p.CodeID).Editable(false);
                model.Field(p => p.Title).Editable(false);
            })
                 //.Read(read => read.Action("GetPersons", "CodeManager", new { classifications = @ViewBag.SelectedCatgory }))
                    .Update(update => update.Action("EditingCustom_Update", "CodeManager"))
                        .Create(update => update.Action("EditingCustom_Update", "CodeManager"))     
        )
            .Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("_CodeEditor"))    
        )

Control:

public ActionResult Index(string classifications = "")
        {
            ViewData["Category"] = classifications;
            ViewData["Classifications"] = new SelectList(Classifications.List, "ClassificationText", "ClassificationText", classifications);
            var codModels = new List<CodeModel>();
            ViewBag.SelectedCatgory = classifications ?? "Type";
 
            if (Request.HttpMethod == "POST")
            {
                var model = _codeRepository.Search(classifications).ToModel();
                return View(model);
            }
 
            return View(codModels);
        }

Model:

blic class CodeModel
    {
        public string CodeID { get; set; }
 
        public string Title { get; set; }
 
        public string Status { get; set; }
 
        public bool Active { get; set; }
 
        public string Category { get; set; }
 
        public int UserID { get; set; }
 
    }




Thanks
Dennis

IsmiKin
Top achievements
Rank 1
 answered on 17 Aug 2012
1 answer
100 views
Hi There,

               I was testing out the demo introduction project for android downloaded from here. As I was thinking that this will be my starting point for a mobile application for my Web application on Telerik MVC 2. But the mobile application cant seems to work. If I access teh Web Api service through Chrome it working fine. attached file has the output of the chrome for service.

           But on the emulator I cant access the service and its just keep on loading. I have checked and found that the request is not reaching the service. 

               Any help will be appreciated.

Thanks Syed
thanhmcad
Top achievements
Rank 1
 answered on 17 Aug 2012
2 answers
130 views

Hi,

I am currently in the process of migrating from the MVC controls to the Kendo UI.
For the MVC controls, there was a work around to the old IE bug where menu sub items were hidden behind object tags. This work around can be seen below.
if ($.browser.msie) {
    var oldFxPlay = $.telerik.fx.play;
 
    $.telerik.fx.play = function () {
 
        var target = $(arguments[1]);
        if (target.is(".t-menu .t-group") && !target.find("iframe").length) {
            target.append("<li style='width:100%;height:100%;z-index:-1;position:absolute;top:0;left:0;'>" +
                      "<iframe src='#' frameborder='0' style='width:100%;height:100%;z-index:-1;position:absolute;'></iframe>" +
                  "</li>");
        }
        oldFxPlay.apply(this, Array.prototype.slice.apply(arguments));
    };
}

I now need something similar for the Kendo UI menu. Is there anything available?

Many thanks in advance for your support.
Andrew
Top achievements
Rank 1
 answered on 17 Aug 2012
4 answers
1.8K+ views
I have a model Kendo window that gets displayed on a large page. The window contains a scrollable grid. Whenever I hit the end of scrolling in the grid, the main webpage scrolls and the window stays where it is. Is there anyway that can be fixed?
Kyle
Top achievements
Rank 1
 answered on 17 Aug 2012
0 answers
189 views
I'm curious if it's possible to place a date picker in the popup when I'm creating a new entry in the grid. 
The actual problem: I have a table with two DateTime columns which are required for each new entry. I'm showing the data from the tables in a kendo ui grid for which I'm using popup editable mode. 
What I need: a way to format the dates entered by users (example: MM/dd/yyyy not the full date time - which is like Fri Aug 17 2012 13:23:53 GMT+0300 (GTB Daylight Time)). 

Is there a way to modify what should be entered in DateTime fields? 
Marius
Top achievements
Rank 1
 asked on 17 Aug 2012
0 answers
94 views
Hello,

I was wondering if it is possible to have both inline cell editing, and popup editing with the edit button in the same grid? The reason i want to do this, is because i have lots of columns in my table, and want to narrow the amount of columns down to only the basics and edit those with the inline cell editing, and have a sort of detail-view with a popup that displays all the fields in a custom template.

Also, is it possible to make the cell editing work with double click?

Hope anyone can help!
Thanks in advance.

-Danny
Danny
Top achievements
Rank 1
 asked on 17 Aug 2012
7 answers
507 views
Whats the best way to specify autocomplete on an input in my view such that I can define the datasource which will populate it?  A method in the observable somehow perhaps?

So question #2
If this is my markup structure
<div>
  <input data-role="numerictextbox" />
  <input data-role="autocomplete" />
  <input data-role="numerictextbox" />
  <input /> //Click this, adds a new row
  <input /> //Click this, deletes this row
</div>

How could that get bound to my model?...I'm not sure I understand the whole binding to an array...if this is even doable?
Atanas Korchev
Telerik team
 answered on 17 Aug 2012
1 answer
106 views
Is it possible to embed a DropDownList or ComboBox in the Kendo menu?  I've done some searching and have not found an answer to this.
Kamen Bundev
Telerik team
 answered on 17 Aug 2012
0 answers
116 views
I have bound the "select" method of my treeview to show some extra info about the node in another pane.
Clickng on a node highlights it and shows the info just fine.
However when I drag a node:
- First of all, does this cause it to be selected?
  Since you start a drag by click then mouse down, does that  "click" select it?
- In any case, the dropped node is not highlighted, but clicking on it does not highlight it
 and does not call the "select" event.that I've defined.

- If I call my treeview.select(some_kitem) is that suppose to call the method that I have bound to the select method
for the treeview?

- Related to all of this,. when a node IS selected (and highlighed), I'd like it if when the user clicks on it,
it calls the select method that I've bound to the treeview, but it does not.
Apparently if a node is selected, it can't be reselected.
I consider this a bug, but I can imagne an app where you wouldn't want this to happen.
Christopher
Top achievements
Rank 1
 asked on 17 Aug 2012
0 answers
107 views
Here is my scripts:



<!doctype html>
<html>
    <head>
        <link href="http://cdn.kendostatic.com/2011.2.804/styles/kendo.common.min.css" rel="stylesheet"/>
        <link href="http://cdn.kendostatic.com/2011.2.804/styles/kendo.kendo.min.css" rel="stylesheet"/>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
        <script src="http://cdn.kendostatic.com/2011.2.804/js/kendo.all.min.js"></script>
    </head>
    <body>
        <div id="grid"></div>
        <script type="text/javascript">
                $(document).ready(function() {
                    $("#grid").kendoGrid({
                        dataSource:  new kendo.data.DataSource({
                            transport: {
                                // specify the XML file to read. The same as read: { url: "books.xml" }
                                read: "books.xml"
                            },
                            schema: {
                                // specify the the schema is XML
                                type: "xml",
                                // the XML element which represents a single data record
                                data: "/books/book",
                                // define the model - the object which will represent a single data record
                                model: {
                                    // configure the fields of the object
                                    fields: {
                                        // the "title" field is mapped to the text of the "title" XML element
                                        title: "title/text()",
                                        // the "author" field is mapped to the text of the "author" XML element
                                        author: "author/text()",
                                        // the "url" field is mapped to the text of the "url" XML element
                                        url: "url/text()",
                                        // the "cover" field is mapped to the "id" attribute of the "book" XML element
                                       cover: "@cover"
                                    }
                                }
                            }
                        }),
                        scrollable: false,
                        sortable: true
                    });
                });
            </script>
    </body>
</html>




the books.xml contains valid xml record. The web page correctly show the result if the books.xml contain more than one record.
However, if there is only one record in the books.xml, the web page show nothing.

Is it a bug? Is there any way to avoid/fix it?

Thank you.

danny
Top achievements
Rank 1
 asked on 17 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
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?