Telerik Forums
Kendo UI for jQuery Forum
1 answer
207 views
Hi
I have 2 dropdown in the edit template.

<input id="1" style="width: 300px" />
<input id="2" disabled="disabled" style="width: 300px" />

on selection of 1st dropdown , I fill 2nd dropdown (using cascading e.g.) ,  for some values in the 1st  dropdown I need to show textbox in place of 2nd dropdown as a result.

How to achieve this?

Nikolay Rusev
Telerik team
 answered on 25 Sep 2013
1 answer
48 views
On http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/mobilelayout/overview#example---get-reference-to-a-kendo-ui-mobilelayout-instance , you should notice that the jQuery call to:
$("#Mobilelayout")
is not using the correct id of the Layout element, which is "MobileLayout".

Kiril Nikolov
Telerik team
 answered on 25 Sep 2013
1 answer
218 views
I have trouble getting the Kendo Grid ASP.NET MVC  Ajax implementation to work
The Javascript/Jquery version worked like a charm, the ASP.NET MVC has been quite a challenge.

I have a grid and a detail template. At first, when I added the ClientTemplate code, the page would display a javascript error of Invalid template. I searched for a while on this and 2 solutions were offered.
1. Commenting the System.WebSecurity.AntiXss enry form the Web.config
2. Using .ToMvcClientTemplate() as created by someone (Extension method on MvcHtmlString). The code for this is below

I tried both the options. now the page loads with no javascript error, but no mater how much i click on the arrow in the row (which should open the tab),
nothing happens. I even have  a break point in the controller that never gets hit.

One final note, when I change the mode to IE9, the page throws a javascript error:
Unhandled exception at line 18, column 19554 in http://localhost:1770/Scripts/kendo/2013.1.514/kendo.web.min.js

Please advise. Here is the code:

@(Html.Kendo().Grid<PPSPortal.Models.ATM>()
                                  .DataSource(dataSource => dataSource
                                      .Ajax()
                                      .Read(read => read.Action("GetATMStatusGrid", "ATM", new { id = participantId, userId = userId, pageid = 3 }))
                                      .PageSize(10)
                                      .ServerOperation(false)
                                   )
                                    .Events(ev => ev.DataBound("onDataBound"))
                                    .Name("Grid")
                                    .Sortable()
                                    .Filterable()
                                    .Pageable()
                                    .ColumnMenu().Events(x=>x.ColumnHide("UpdateColumnsWhenHidden").ColumnShow("UpdateColumnsWhenShown"))
                                    .Groupable()
                                    .ClientDetailTemplateId("template")
                                    .Columns(cl=>
                                        {
                                            cl.Bound(x => x.Id);
                                            cl.Bound(x => x.Name);
                                            cl.Bound(x => x.Status);
                                            cl.Bound(x => x.Active);
                                            cl.Bound(x => x.Online);
                                            cl.Bound(x => x.TotalCashRemaining).Format("{0:c}") ;
                                            cl.Bound(x => x.LastMessageFromATM);
                                            cl.Bound(x => x.LastMessageToATM);
                                            cl.Bound(x => x.GroupName);
                                            cl.Bound(x => x.Location);
                                        })
                                    .ToolBar(toolbar =>
                                    {
                                        toolbar.Template(@<text>
                                            <div class="toolbar">
                                                <table>
                                                    <tr>
                                                        <td>
                                                            @Html.JHAButton("Excel", "", "Export To Excel")
                                                            @Html.JHAButton("CSV", "", "Export To CSV")</td>
                                                    </tr>
                                                </table>
                                            </div>
                                            </text>);
                                    })
                )

@(Html.Kendo().TabStrip()
            .Name("tabStrip_#=Id#")
            .SelectedIndex(0)
            .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
            .Items(items =>
            {
                items.Add().Text("Events").Content(@<text>
                    @(Html.Kendo().Grid<PPSPortal.Models.ATMDetails>()
                        .Name("grid_#=Id#")
                        .Columns(columns =>
                        {
                            columns.Bound(o => o.Event).Width(56);
                            columns.Bound(o => o.MessageParamValue).Width(110);
                        })
                        .DataSource(dataSource => dataSource
                            .Ajax()
                            .PageSize(5)
                            .Read(read => read.Action("GetDetails", "ATM", new { id = @participantId, termId = "#=Id#", termName = "#=Name#" }))
                        )
                        .Pageable()
                        .Sortable()
                        .ToClientTemplate())
                </text>                        
                );
                items.Add().Text("Cassette Details").Content(
                "<div class='cassette-details'>" +
                "</div>"
                );                
            })
            .ToClientTemplate().ToMvcClientTemplate())


The MvcHtmlString extension method:

    public static class KendoMvcExtensions
    {
        public static IHtmlString ToMvcClientTemplate(this MvcHtmlString mvcString)
        {
            if (HttpEncoder.Current.GetType() == typeof(AntiXssEncoder))
            {
                var initial = mvcString.ToHtmlString();
                var corrected = initial.Replace("\\u0026", "&").Replace("%23", "#").Replace("%3D", "=").Replace("&#32;", " ");
                return new HtmlString(corrected);
            }

            return mvcString;
        }
    }

Another problem is that even though I have specified Groupable above, that does not work either. A circle with a line across it appears.
i suspect it could be the js files I am referencing.
They are bundled in the BundleConfig.cs.

This is the BundleConfig.cs


public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                        "~/Scripts/jquery-ui-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));

            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));


            bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                        "~/Content/themes/base/jquery.ui.core.css",
                        "~/Content/themes/base/jquery.ui.resizable.css",
                        "~/Content/themes/base/jquery.ui.selectable.css",
                        "~/Content/themes/base/jquery.ui.accordion.css",
                        "~/Content/themes/base/jquery.ui.autocomplete.css",
                        "~/Content/themes/base/jquery.ui.button.css",
                        "~/Content/themes/base/jquery.ui.dialog.css",
                        "~/Content/themes/base/jquery.ui.slider.css",
                        "~/Content/themes/base/jquery.ui.tabs.css",
                        "~/Content/themes/base/jquery.ui.datepicker.css",
                        "~/Content/themes/base/jquery.ui.progressbar.css",
                        "~/Content/themes/base/jquery.ui.theme.css"));

            // Script bundles
            bundles.Add(new ScriptBundle("~/bundles/jhaCtls").Include(
                        "~/Telerik/js/jquery.min.js",
                        "~/Scripts/kendo/2013.1.514/kendo.web.min.js",
                        "~/Scripts/kendo/2013.1.514/kendo.all.min.js",
                        "~/Scripts/kendo/2013.1.514/kendo.aspnetmvc.min.js",
                        //"~/Scripts/kendo/2013.1.514/kendo.dataviz.min.js",
                        //"~/Scripts/kendo/2013.1.514/jquery.min.js",
                        "~/HTMLCtls/js/JHAHTMLCtls-2013.1.1.0.min.js"));

            // Style bundles
            bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
            bundles.Add(new StyleBundle("~/Telerik/css").Include("~/Telerik/styles/kendo.common.min.css", "~/Telerik/styles/kendo.dataviz.min.css"));
        }
    }
Daniel
Telerik team
 answered on 25 Sep 2013
1 answer
161 views
Hi

I'm trying to use the kendo upload web control with C#, I can upload the controls is always on error, I know that I have to return an empty response but I don't know exactly how. This is my javascript

<script>
            $(document).ready(function () {
                $("#files").kendoUpload({
                    async: {
                        saveUrl: "Attachments.aspx",
                        removeUrl: "remove",
                        autoUpload: true
                    }
                });
            });
        </script>

and on C# I have

protected void Page_Load(object sender, EventArgs e)
    {
        HttpFileCollection x = Request.Files;

        if (x.Count>0)
        {
            Response.Clear();
            Response.ContentType = "application/json";
            Response.Write("{}"); 
        }
    }

I tried with Response.Write("") to with and without contentype but it didn't work.

Do anyone know how to build the correct success response?
Erick
Top achievements
Rank 1
 answered on 24 Sep 2013
2 answers
359 views

I have a ListView template that contains an index field (VentTypeId) and a text field (VentDescription) that shows text for the index field. The text field getter does a lookup up for the text corresponding to the index field.  I have an EditorTemplate with a dropdownlist to modify the index field, and after the save the index field is changed but the text field is not. I suppose I need to indicate that the text field has to be re-bound in the template after the edit, but don't know how.

Here is the relevant part of the View:

@(Html.Kendo().ListView<VentSetting>()
    .Name("VentSettings")
    .TagName("div")
    .ClientTemplateId("ventTemplate")
    .Editable()
    .DataSource(datasource => datasource
        .Model(model => model.Id(m => m.VentSettingId))
        .Read(read => read.Action("ReadVentSettings", "Run"))
        .Update(update => update.Action("UpdateVentSetting", "Run"))
    )
)

The relevant part of the template. Here the VentTypeId displays the changed value but the VentDescription field does not:

<script type="text/x-kendo-tmpl" id="ventTemplate">
    <div>
            <span>VentTypeId:</span><span>#:VentTypeId#</span>
            <span>Vent:</span><span>#:VentDescription# </span>
        </div>
    </div>
</script>

The relevant parts of the EditorTemplate

<div>
    @Html.Kendo().DropDownListFor(x => x.VentTypeId)
          .DataValueField("VentTypeId")
          .DataTextField("Description")
          .BindTo((System.Collections.IEnumerable)ViewData["VentTypes"])
 
    <div class="edit-buttons">
        <a class="k-button k-button-icontext k-update-button" href="\\#"><span class="k-icon k-update"></span>Save</a>
        <a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span>Cancel</a>
    </div>
 
</div>

The relevant parts of the VentSetting model:

public class VentSetting
{
        public int VentTypeId { get; set; }
 
        public string VentDescription
        {
            get
            {
                return VentTypeId == null ? "" : GetVentTypes().Single(v => v.VentTypeId == VentTypeId).Description;
            }
        }
    }

Any help would be appreciated.

Steve

Steve
Top achievements
Rank 1
 answered on 24 Sep 2013
4 answers
2.3K+ views
So I have a combobox that I have given a width of 100px.  The dropdown on the combobox however I would like to be about 300px wide.  It appears that the width of the dropdown is limited by the width of the actual combobox.

I've tried using templates to make the dropdown wider, but then it just puts a horizontal scrollbar in.

The reason I want this is that  for the dropdown we are displaying both a Code and the Description of the code such as "02343 - Some Descrition Here", but then when they select an option just the code goes into the combobox...  That being said we have everything working except for the width of the dropdown portion of the combobox.

Thanks
Jason
Top achievements
Rank 1
 answered on 24 Sep 2013
7 answers
1.3K+ views
I've managed to get the data through the read method, as already got the otherCRUD operations. However I want to know how to get the result (true or false) of an operation (create, update or delete) coming from my PHP script on the server. Here's the code:

Kendo:

 var JsonDataSource = new kendo.data.DataSource({
                        transport: {
                            read: {
                                url: "alunos_read.php", 
                                dataType: "json"
                            },
                            create: {
                                url: "alunos_add.php", 
                                type: "POST"
                            },
                            update: {
                                url: "alunos_update.php",
                                type: "POST"

      ...

PHP:

        mysql_query("update alunos set aluno = '".$aluno."' where cod_aluno = '".$cod_aluno."'");
$result = array('result' => (mysqli_affected_rows >= 0));
           
echo json_encode($result); // I want to get this overall result and show in an alert () functionHow do I do this?
KV
Top achievements
Rank 1
 answered on 24 Sep 2013
2 answers
141 views
I am getting an error after updating to the Q2 2013 SP. I was previously on Q2 2013.

Am I missing something? When I try to use kendo.core.js I get a syntax error.
Uncaught TypeError: Cannot set property 'en-US' of undefined kendo.core.js:472
Where line 472 is the following. kendo.cultures hasn't been initialized anywhere.
kendo.cultures["en-US"] = {
Prior to this release that line read:
kendo.cultures = {"en-US" : {

Am I mistaken or missing a dependency?
Ryan
Top achievements
Rank 1
 answered on 24 Sep 2013
1 answer
154 views
Hello,

Is there i way to get the numerictextbox so it starts with 01-02-03 etc?

Thanks
Georgi Krustev
Telerik team
 answered on 24 Sep 2013
5 answers
643 views
Please don't think I am a jaded customer because I love how using Kendo UI has made me look much better than I am by using your awesome controls.  However, I am using the new scheduler and I am a little frustrated with the (beta) documentation.  So I am finding myself relying on this forum.  Please help.

I need to repopulate the scheduler when a new user has been selected in a companion grid on the page.  I get the selection event with no problem.  Now I just need to know the best way to tell the scheduler to retrieve fresh data from the server based upon the value in the selection event.  After reading through much of the documentation and many of these threads I have come to the conclusion I need to set the dataSource to "serverFiltering: true" and then simply set a new filter.  That didn't call my "Get" function so I tried to force a read call directly.  Still nothing.  Am I approaching this correctly?  What is the best way to handle this?
function onSelectProvider(arg) {
 
     $("#scheduler").filter = { field: "Idd", operator: "eq", value: arg.Text };
     $("#scheduler").dataSource.read();
 }
Entilzha
Top achievements
Rank 2
 answered on 24 Sep 2013
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
Iron
Iron
Sergii
Top achievements
Rank 1
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
Iron
Iron
Sergii
Top achievements
Rank 1
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?