Telerik Forums
Kendo UI for jQuery Forum
1 answer
334 views
hi,
i'm using the kendo datepicker but i want to add a custom validation rule to this.. how do i go about it? if i combine datepicker + validator, the validation is triggered on clicking the date calender button.
Iliana Dyankova
Telerik team
 answered on 06 Aug 2012
2 answers
243 views
//THE COMBOBOX 
 @(Html.Kendo()
                  .ComboBox()
                  .HtmlAttributes(new { style = "width: 900px" })
                  .Name("cbTscmis")
                  .Filter(FilterType.StartsWith)
                  .MinLength(3)
                  .Suggest(true)
                  .HighlightFirst(true)
                  .DataSource(source =>
                  {
                      source.Read(read =>
                      {
                          read.Action("_LoadTscmisData", "Event", new { area = "Event" });
                      }).ServerFiltering(true);
                  }))



//THE ACTION METHOD
public ActionResult _LoadTscmisData(string text)

//THE ERROR WHE THE PAGE LOADS
Object doesn't support property or method 'requestData'
Ryan Lege
Top achievements
Rank 1
 answered on 06 Aug 2012
1 answer
508 views
I am using ASP.NET kendo grid helper and server binding. I want to have an anchor element with its id is the concatenated string text and the dynamic value of @item.ID, so I have something like:
cols.Bound(p => p.ID)
   .Template(@<text><a id="Foo_\@item.ID" href= "#someLink" > @item.ID </a></text>);

this code works and:

.Template(@<text><a id="@item.ID" href= "#someLink" > @item.ID </a></text>);

using bare @item.ID or with "\" or "/" or "-" and other symbols, its value is dynamic indeed,
BUT if I instead use just "Foo_@item.ID", the id resulted is as is -> "Foo_@item.ID"

What should I code in order to properly concatenate strings with @item.ID in a column template?
Thanks!
Avitot
Top achievements
Rank 1
 answered on 06 Aug 2012
1 answer
150 views
Hi can you please tell me if the following approach the best for consuming the data from SQL utilizing WebService. 
The following code is working correctly. However I need to know if I'm designing dataSource correctly. At this stage I'm only intending to read the data.

DataViewModel

public class LedgerViewModel
{
    public int? lindex { get; set; }
    public int? linvoice { get; set; }
    public string lperiod { get; set; }
    public decimal? lamount { get; set; }
}

WebService

[WebMethod(Description = "Gets ledger info")]
       public List<LedgerViewModel> Read()
       {
            
           using (var db = new LedgerConnection())
           {
               return db.ledgers.Where(x => x.lmatter == "2007714")
                   .Select(l => new LedgerViewModel
                   {
                       lindex = l.lindex,
                       linvoice = l.linvoice,
                       lamount = l.lamount,
                       lperiod = l.lperiod
                   }).ToList();
           }
       }

Sample WebService Output

<ArrayOfLedgerViewModel>
  <LedgerViewModel>
    <lindex>698567</lindex>
    <linvoice>871181</linvoice>
    <lperiod>0511</lperiod>
    <lamount>0.0000</lamount>
  </LedgerViewModel>
  <LedgerViewModel>
    <lindex>698568</lindex>
    <linvoice>871181</linvoice>
    <lperiod>0511</lperiod>
    <lamount>0.0000</lamount>
  </LedgerViewModel>
</ArrayOfLedgerViewModel>

Kendo UI dataSource

dataSource: {
      transport: { }
          read: {
              url: "GetLedger.asmx/Read",
              contentType: "application/json; charset=utf-8",
              type: "POST"
          }
      },
      schema: {
          type: "xml",
          data: "/ArrayOfLedgerViewModel/LedgerViewModel",
          model: {
              fields: {
                  linvoice: "linvoice/text()",
                  lperiod: "lperiod/text()",
                  lamount: "lamount/text()"
              }
          }
      },
        sort: {
            field: "lperiod",
            dir: "asc"
        }
    }

Daniel
Top achievements
Rank 1
 answered on 06 Aug 2012
0 answers
181 views
Dear KendoUI Community,

I'am working on a WebApplication, based upon Backbone.js, Rails3 as JSON API and want now include KendoUI.

If I visit the Show-View for a selected Object (www.dogspots.de/#spots/1), my browser performs 2 JSON-Requests to the Server and I have an JS-Error: http://i48.tinypic.com/akbacn.png (Uncaught TypeError: Cannot call method 'getAttribute' of undefined)
When I disable KendoUI again, everything is fine: http://i45.tinypic.com/30t74o0.png (no JS error and 1 JSON-Request)

I believe that Backbone an KendoUI performs both an request to the server, unfortunately is KendoUI not able to parse my JSON response, which results into a JS-Error and a blank Layout

My Solution would be to disable de router-module of KendoUI and keep the work on Backbone.js. Do you agree with me?
I also tried to include your kendo.backbone.js example on github, but it doesn't changed anything.

You can also see a preview with this error on www.dogspots.de

Best regards
Gerrit
Gerrit
Top achievements
Rank 1
 asked on 05 Aug 2012
0 answers
194 views
Is the kendo upload control capable of invoking an ASP.NET webforms page method?  For instance:

        [WebMethod]
        public static string FileUpload(string id) { ... }

I see the control posting-back asynchronously, but this method is never invoked.  Here is the control creation logic:

var crudServiceBaseUrl = "Default.aspx";
 
           $("#files").kendoUpload({
               async: {
                   saveUrl: crudServiceBaseUrl + "/FileUpload",
                   autoUpload: false
               },
               multiple: false,
               showFileList: true,
           });


Dan
Daniel
Top achievements
Rank 1
 asked on 05 Aug 2012
0 answers
125 views
Hello I am testing out several UI sets for JQuery. I am really impressed with Kendo. But I am having trouble with a custom editor. I was able to get a date picker working in the grid, just not a combo box. Here is my code. It shows the box, just doesn't return the selection. I based this off your example, but can't make it work. function statusDropDownEditor(container, options) {        $('<input data-text-field="StatusName" data-value-field="StatusName" data-bind="value:' + options.field + '"/>')             .appendTo(container)             .kendoComboBox({                   dataTextField: "text",                     dataValueField: "value",                     dataSource: [                         { "text":"Open", "value":"opn" },                         { "text":"Approved", "value":"app" },                         { "text":"Declared", "value": "dec" },                         { "text":"Dispursed", "value": "dis" }                     ]});     }   This shows the drop down, however it doesn’t put the newly selected item in the field.   I am unsure as to why it wouldn’t.  Also - can I have columns protected based on the row they are on, for example on row one they are editable, but not row two? Thanks.
Dark
Top achievements
Rank 1
 asked on 03 Aug 2012
1 answer
382 views
In the below piece of code the binding seems to be one way - Model to View. However when the element value is modified the corresponding Model value is not updated. 

The Input fields load the data from the array correctly but after the data has been modified in the input fields the variables "viewModel"  and "data" are not updated. (Modify the name of Perry Sofa and click the "click" button below.)

Is there anyway I can achieve two way binding - (Model to View and View to Model)? Apologies in advance for using relative paths of the kendo and jquery js files.

<!DOCTYPE html>
<html>
<head>
    <title>Source and template binding</title>
    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
     <link href="../../../styles/kendo.common.min.css" rel="stylesheet" />
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet" />
    <script>
    var data;
    var viewModel;
    function showVM()
    {
    alert(viewModel.get('products[1].name'));
    }
    </script>
    <script id="template" type="text/x-kendo-template">
    <div>
    <input type="text" data-bind="text: name" value="${name}"></input><br>
    <input data-bind="text: unitsInStock" value="${unitsInStock}"></input><br>
    <button class="k-button" data-bind="click: deleteProduct">Delete</button><br>
</div>    
    </script>
</head>
<body>
    <div id="example" class="k-content">
    <div data-template="template" data-bind="source: products"></div>
<script>
    $(document).ready(function() {
    data = [
                { name: "Hampton Sofa", price: 989.99, unitsInStock: 39 },
                { name: "Perry Sofa", price: 559.99, unitsInStock: 17 },
                { name: "Donovan Sofa", price: 719.99, unitsInStock: 29 },
                { name: "Markus Sofa", price: 839.99, unitsInStock: 3 }
            ];
        viewModel = kendo.observable({
            products: data
        });
        kendo.bind($("#example"), viewModel);
    });
    </script>   
<input type="button" onclick="showVM()" value="click"/>
</div>
</body>
</html>
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 03 Aug 2012
1 answer
161 views
I want to display data on particular dates, i have two array which contains some dates, if my current date matches with tht array date then i want to shoe some value from tht array.
I tried to use each loop on that array on content of calendar but its giving runtime error called Invalid Template.....Any Suggestions????

I have two array which are Two dimensional,

 

populateCalendar:

 

function (Holiday) { 

var  holidaydateList = []

//constructing holidaydatelist array from Holiday object...
$.each(Holiday, function (index, model) { 
var day = model.HolidayDate.toString();  
holidaydateList.push({ HolidayDate: day.substring(6, day.length - 2), HolidayData: model.HolidayName });
});

$("#forecastCalendar").kendoCalendar({  
//value: today, 
month: {
// template for dates in month view 
content: 
'# jQuery.each([' + holidaydateList + '],function(index,item){ #'
'# if (item.HolidayDate == +data.date) { #'
'<div style="background-color: Aqua">item.HolidayData</div>'
'# } else { #'
'<div></div>'
'# } #'
'# }); #'
'#= data.value #' 
},
footer: 
"Today - #=kendo.toString(data, 'd') #" 

});

Kumarasen
Top achievements
Rank 1
 answered on 03 Aug 2012
1 answer
219 views
As is modeled in this jsfiddle, when one selects an item via the mouse, the event is raised.  My question is, why isn't the event raised when the user clicks on the button?

Is this a bug?  In the docs it clearly states that the select event is "triggered when an item of a PanelBar is selected."
Frank
Top achievements
Rank 1
 answered on 03 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?