Telerik Forums
Kendo UI for jQuery Forum
3 answers
207 views
I am using Kendo()comboBox(). I cannot get the change event of CustomerId comboBox  to clear StateAbbreviation comboBox

<div class="SectionBoxGradient" style="padding: 10px">
    @using (@Html.BeginForm("AddCustomer", "TotalvCRM", FormMethod.Post, new{id="CustomerForm"}))
    {
         
        <table>
            <tr>
                <td class="FieldLabel"><input type="hidden" id="CustomerName" name="CustomerName"/>@Html.LabelFor(model => model.CustomerName):</td>
                <td>@(Html.Kendo().ComboBox().Name("CustomerId").DataTextField("Text").DataValueField("Value").BindTo(Model.Customers).Placeholder("-- Select a Customer --")) </td>
                <td class="FieldLabel">@Html.LabelFor(model => model.CustomerId):</td>
                <td class="FieldLabel" style="text-align: left;"><input type="text" id="lblCustomerId" value="@Model.CustomerId" style="background: #569bbe; border:none;" disabled="disabled"/></td>
                <td class="FieldLabel"><label id="labelCreateDate" title="CreateDate"></label></td>
            </tr>
            <tr>
                <td class="FieldLabel">@Html.LabelFor(model => model.Address1)</td>
                <td>@Html.TextBoxFor(model => model.Address1,new{tabindex="2"})
                    @Html.ValidationMessageFor(model => model.Address1)</td>
                <td class="FieldLabel">@Html.LabelFor(model => model.BusinessPhoneNumber)</td>
                <td>@Html.TextBoxFor(model => model.BusinessPhoneNumber,new{tabindex="7"})</td>
                <td class="FieldLabel" style="text-align: left;"><label id="labelAssignedReps" title="Assigned Representitive" >Assigned Representatives:</label></td>
            </tr>
            <tr>
                <td class="FieldLabel">@Html.LabelFor(model => model.Address2)</td>
                <td>@Html.TextBoxFor(model => model.Address2,new{tabindex="3"})</td>
                <td class="FieldLabel">@Html.LabelFor(model => model.FaxPhoneNumber):</td>
                <td>@Html.TextBoxFor(model => model.FaxPhoneNumber, new { tabindex = "8" })</td>
                <td rowspan="3">@Html.ListBox("AssignedReps",Model.AssignedReps, new{disabled = "disabled", style = "width:100px"})</td>
            </tr>
            <tr>
                <td class="FieldLabel">@Html.LabelFor(model => model.City)</td>
                <td>@Html.TextBoxFor(model => model.City, new{tabindex = "4"})
                    @Html.ValidationMessageFor(model => model.City)</td>
                <td class="FieldLabel">@Html.LabelFor(model => model.WebUrl):</td>
                <td>@Html.TextBoxFor(model => model.WebUrl, new { tabindex = "9" })</td>
            </tr>
            <tr>
                <td class="FieldLabel"><label id="labelState" title="State">State:</label></td>
                <td> @(Html.Kendo().ComboBox()
                        .Name("StateAbbreviation")
                        .DataTextField("Text")
                        .DataValueField("Value")
                        .Filter(FilterType.Contains)
                        .DataSource(source => source.Read(read => read.Action("GetStatesList", "List")))
                        .Placeholder("-- Select a State --"))</td>
                <td class="FieldLabel"></td>
                <td></td>
            </tr>
            <tr>
                <td class="FieldLabel">@Html.LabelFor(model => model.ZipCode)</td>
                <td>@Html.TextBoxFor(model => model.ZipCode, new{tabindex="6"})
                    @Html.ValidationMessageFor(model => model.ZipCode)</td>
                <td></td>
                <td></td>
                <td>
                    @if (Model.CustomerId == 0)
                     { <a href=@Url.Action("AssignReps", "TotalvCRM", new { id = Model.CustomerId}) id="lnkAssignRepsAction" disabled = "disabled" class="button" >Assign Reps...</a> }
                     else
                     {<a href=@Url.Action("AssignReps", "TotalvCRM", new { id = Model.CustomerId }) id="lnkAssignRepsAction" class="button">Assign Reps...</a>}
                </td>
            </tr>
            <tr>
                <td class="FieldLabel"><label id="labelNotes" title="Notes" >Notes:</label></td>
                <td colspan="3">@Html.TextAreaFor(model => model.Note, new { @cols = "75", @rows = "5", tabindex = "11" })</td>
                <td>
                    <table>
                        <tr>
                            <td class="FieldLabel" style="text-align: left;"><label id="labelCustomerCategories" title="CustomerCategories" >Customer Categories:</label></td>
                        </tr>
                        <tr>
                            <td>@Html.ListBox("CustomerCategories", Model.CustomerCategories, new { disabled = "disabled", style = "width:100px" })</td>
                        </tr>
                        <tr>
                            <td>@if (Model.CustomerId == 0)
                     { <a href=@Url.Action("CustomerCategories", "TotalvCRM", new { id = Model.CustomerId}) id="lnkCustomerCategories" disabled = "disabled"  class="button" >Customer Categories...</a> }
                     else
                     {<a href=@Url.Action("CustomerCategories", "TotalvCRM", new { id = Model.CustomerId }) id="lnkCustomerCategories"  class="button">Customer Categories...</a>} </td>
                        </tr>
                    </table>
                     
                </td>
            </tr>
            <tr>
                <td colspan="4" >
                    <a href="JavaScript:void(0);" onclick="formSubmit();"  class="button">Add Customer</a>
                    @if (Roles.IsUserInRole("Administrator") || Roles.IsUserInRole("Manager"))
                    {
                                <a href="javascript:void(0);" onclick="DeleteCustomer()"  class="button">Delete Customer</a>
                    }
                     @if (Model.CustomerId == 0)
                      {
                          <a href="@Url.Action("UploadCustomerFile", "TotalvCRM", new {id= Model.CustomerId })" disabled="disabled"  class="button">Add Attachment</a>
                      }
                      else
                      {
                          <a href="@Url.Action("UploadCustomerFile", "TotalvCRM", new { id = Model.CustomerId })"  class="button">Add Attachment</a>
                      }
                     @Html.ActionLink("Export To Excel...", "ExportCustomersToExcel", null,new{@class="button"})
                </td>
            </tr>
        </table>
    }
</div>
Here is the Jquery:

var customerCombobox = $("#CustomerId").kendoComboBox();
customerCombobox.bind("change", function (e) {
    var customerId = this.value;
    var stateAbbreviation = $("#StateAbbreviation");
     
    if (!$.isNumeric(customerId)) {
        //$("#CustomerId").val(this.value);
        $("#CustomerName").val(this.value);
        $("#lblCustomerId").val("0");
        $("#Address1").val('');
        $("#Address2").val('');
        $("#City").val('');
        $("#ZipCode").val('');
        $("#WebUrl").val('');
        $("#CustomerTypeId").val('');
        $("#BusinessPhoneNumber").val('');
        $("#FaxPhoneNumber").val('');
        $("#AssignedReps").val('');
        stateAbbreviation.val('');
 
 
    } else {
        window.location = '/Controller/Customer/' + this.value;
    }
});
 
var $stateAbbreviation = $("#StateAbbreviation").kendoComboBox();
$stateAbbreviation.bind("change", function(e) {
    e.preventDefault();
});
Here is the model:
[NotMapped]
public class EditCustomer
{
    #region Customer Attributes
 
    public int CustomerId { get; set; }
 
    [Display(Name = "Customer Name")]
    [StringLength(100, ErrorMessage = "The {0} must be less than 100 characters long.")]
    public string CustomerName { get; set; }
 
    [Display(Name = "Type")]
    public int? CustomerTypeId { get; set; }
 
    [Display(Name = "Web Site")]
    public string WebUrl { get; set; }
 
    [Display(Name = "Group")]
    public string Group { get; set; }
 
    public string Note { get; set; }
     
    #endregion
 
    #region Address Attributes
 
    [Display(Name = "Address Id:")]
    public int AddressId { get; set; }
 
    [Display(Name = "Address Type:")]
    public CRMAddressType AddressType { get; set; }
 
    [StringLength(100, ErrorMessage = "The {0} must be less than 100 characters long.")]
    [Display(Name = "Address 1:")]
    public string Address1 { get; set; }
 
    [StringLength(100, ErrorMessage = "The {0} must be less than 100 characters long.")]
    [Display(Name = "Address 2:")]
    public string Address2 { get; set; }
 
    [StringLength(100, ErrorMessage = "The {0} must be less than 100 characters long.")]
    [Display(Name = "City:")]
    public string City { get; set; }
 
    [Display(Name = "State:")]
    [StringLength(2, ErrorMessage = "The {0} must be 2 characters long.")]
    public string StateAbbreviation { get; set; }
 
    [StringLength(10, ErrorMessage = "The {0} must be less than 10 characters long.")]
    [Display(Name = "ZipCode:")]
    public string ZipCode { get; set; }
 
    #endregion

Gordon
Top achievements
Rank 2
 answered on 11 Jun 2013
4 answers
167 views
Hi,

My list is having problems displaying new added items when bounded to grouped datasource.
When adding new items, the list shows the item itself as a group header.

I've attached an example showing it.
replace the attached file with kendoui.complete.2013.1.514.trial\examples\mobile\listview\databinding.html
you can see I've changed the original example: after 1.5 seconds i'm adding another item, and as you can see,
the item is shown as an header.
The same operation works fine on previous version.
Dean
Top achievements
Rank 1
 answered on 11 Jun 2013
0 answers
115 views
I have created an online CodePen Demo: http://codepen.io/DrYSG/pen/wnDxL where I have a Grid bound to a KendoObservable 1-D array. The Array is meant to be (Item, Value) pairs. There are a number of clumsy things here that I would like to clean up.
  • I would love it if you supported Grid's that had Vertical Orientation, so that I could just have display 1-D array, and use the Column Headings for each item: see: http://www.kendoui.com/forums/ui/general-discussions/vertical-grid-property-grid.aspx
  • Doing the lookup for the value and changing it involves hard constants (stateTable[1].Value = foo. Do I have to have a use an index table that translates integers to keys. I.e. var StatusKey = 0, TileCountKey = 1, etc.  (then it would be stateTable[TileCountKey] = 2) Still seems clumsy.
  • This would be especially fragile, if the user could add and delete rows. (batch editing).
  • The KendoObservable.set() is not working for this example. So I am doing a manual trigger, which I saw in a post by Alexander Valchev, but I don't see document anywhere. This also feels a bit clumsy.
  • Why is there a scroll bar on my Grid?
Bottom line. It works now, but I want to know if there is something in KendoUI today, that would make this cleaner, and if not, do you have anything in UserVoice planned to fix this up?
Dr.YSG
Top achievements
Rank 2
 asked on 10 Jun 2013
2 answers
123 views
I'm trying to set the background of a screen that only displays an image. I have tried a few things on the css but it seems I'm not using the correct class to achieve the background change. I want to set the background color to black since the default is white. 
Norman
Top achievements
Rank 2
 answered on 10 Jun 2013
1 answer
201 views
I have a tabstrip with two tabs.   The first tab is a list of documents in a grid.   The second tab is an upload control and these work perfect independently.   I need to refresh the partial view grid though on the first tab click as the users will upload files on the second tab then I need the first tab to reflect the added files. 

Thanks all
Ram
Top achievements
Rank 1
 answered on 10 Jun 2013
8 answers
263 views
Hey,
Ive got a set of data which im using for a kendo line chart and it renders it fine, I use the same dataset on a stockchart (type: line) and choose the same baseUnit as the line chart and it crashes. It happens probably because there are too many point. Could this be the case that a simple line chart can handle that amount of points and the stock chart cant.
Regards,
Neil
Iliana Dyankova
Telerik team
 answered on 10 Jun 2013
2 answers
100 views
I am new to Kendoui and have been setting up my own css sheet to modify minor elements of the the Kendo defaults and need to know the difference between roles and classes.  I am familiar to the concept of class from using html coding, but I am new to the concept of roles.  Could someone give an idiots brief to how the roles affect the layout and whether they can also be modified?
Many thanks
marion
Top achievements
Rank 1
 answered on 10 Jun 2013
2 answers
153 views
I have partial views under 7 tabs. first 1-2 tabs loads the content but after that it throws "loading failded" error. Please help.

Here is my code:

@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Events(events => events
//.Select("onSelect")
//.Activate("onActivate")
.ContentLoad("onContentLoad")
.Error("onError")
)

.Items(tabstrip =>
{
tabstrip.Add().Text("Specifics")
.Selected(true)
.LoadContentFrom("SelectSpecifics", "Citation", new { id = @Model.CitationID, docType = @Model.DocType });

tabstrip.Add().Text("Authors")
.LoadContentFrom("Authors", "CitationAuthors", new { id = @Model.CitationID });

tabstrip.Add().Text("Abstract")
.LoadContentFrom("Abstract", "CitationAbstract", new { id = @Model.CitationID });

tabstrip.Add().Text("Notes")
.LoadContentFrom("Notes", "CitationNotes", new { id = @Model.CitationID });


tabstrip.Add().Text("Descriptors")
.LoadContentFrom("Descriptors", "CitationDescriptors", new { id = @Model.CitationID });


tabstrip.Add().Text("Groups")
.LoadContentFrom("Groups", "CitationGroups", new { id = @Model.CitationID });

tabstrip.Add().Text("DeletionHistory")
.LoadContentFrom("DeletionHistory", "CitationHistory", new { id = @Model.CitationID });

tabstrip.Add().Text("RetrievalHistory")
.LoadContentFrom("RetrievalHistory", "CitationHistory", new { id = @Model.CitationID });

tabstrip.Add().Text("Accession No.")
.LoadContentFrom("AccessionNumber", "CitationHistory", new { id = @Model.CitationID });


tabstrip.Add().Text("CopyRequest")
.LoadContentFrom("CopyRequest", "CopyRequest", new { id = @Model.CitationID });


tabstrip.Add().Text("Events")
.LoadContentFrom("Events", "CitationEvents", new { id = @Model.CitationID });

tabstrip.Add().Text("ClearingHouse")
.LoadContentFrom("ClearingHouse", "CitationClearingHouse", new { id = @Model.CitationID });
})
)

</div>

<p>
<input type="submit" id="btnSubmit" value="Submit" name="submit" />
<input type="submit" id="btnCancel" value="Cancel" name="cancel" />

</p>
}

<script>
function onSelect(e) {
//kendoConsole.log("Selected: " + $(e.item).find("> .k-link").text());
alert("Activate fired");

}

function onActivate(e) {
//kendoConsole.log("Activated: " + $(e.item).find("> .k-link").text());
alert("Activate fired");

}

function onContentLoad(e) {
//kendoConsole.log("Content loaded in <b>"+ $(e.item).find("> .k-link").text() + "</b> and starts with <b>" + $(e.contentElement).text().substr(0, 20) + "...</b>");
//alert("Activate fired");


}

function onError(e) {
//kendoConsole.error("Loading failed with " + e.xhr.statusText + " " + e.xhr.status);
alert("error fired");
}
 
Thanks
Vandana
Petur Subev
Telerik team
 answered on 10 Jun 2013
3 answers
449 views
Hi!
I'm developing a Kendo Mobile App for which I'm using Charts and Grids contained in a ScrollView Widget. The problem is when I swype, the labels from the pie chart legend interfere because they are clickable. Is there a way to disable this functionality. Disabling the legend is not an option... The API reference doesn't mention anything about this. Please help.
Alexandru
Top achievements
Rank 1
 answered on 10 Jun 2013
5 answers
543 views
After creating the tab with:
$elem.kendoTabStrip({
    animation: {
        open: {
            effects: effet
        }
    }
});
I do:
var objKendoTabStrip = $elem.data("kendoTabStrip")
objKendoTabStrip.select("li:contains(" + tab + ")")
I can see that the tab is selected, but ton content are not displayed. I think the tab do not extend. If I click on another tab, I see the selected tab momentary fadeout and then the new tab fadein.
Any suggestion?
Thanks
Daniel
Telerik team
 answered on 10 Jun 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
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?