Telerik Forums
Kendo UI for jQuery Forum
3 answers
853 views
hi,

If I have a <ul> made up of checkboxes of the same name (to prompt the user to select more then one choice via checkbox), how can I validate they did check off at least one option?

I tried putting the 'required' attribute in both the ul level and the input level... it either doesn't do anything, or it requires the user to check off every single check box (instead of just one or more).

Here's the HTML (this works fine with Radio buttons and Kendo BTW, you can change the type to RadioButton and see. but as checkbox, it breaks)

<form> 
   <!-- in this case, I set required at the ul level !-->
   <ul required="required" validationMessage="You must enter a gender">
      <li>
        <input id="male" name="mf" type="checkbox" value="Male" />
        <label  for="male">Male</label>
      </li>
      <li>
        <input id="female" name="mf"  type="checkbox" value="Female" />
        <label for="female">Female</label>
      </li>
    </ul>
   <!-- in this case, I set it at the input level -->
   <ul required="required" validationMessage="You must enter a gender2">
      <li>
        <input id="male2" name="mf2" type="checkbox" value="Male2" required />
        <label  for="male">Male2</label>
      </li>
      <li>
        <input id="female2" name="mf2" type="checkbox" value="Female2" required />
        <label for="female">Female2</label>
      </li>
    </ul>
   <input type="submit" value="submit">
  </form>
thanks!
Petur Subev
Telerik team
 answered on 13 Feb 2013
3 answers
168 views
I'm trying to use a linear guage in a template.  I have a series of records in my data source that contain a PercentFull and I want to use the Linear Guage to represent the percentage.  I'm trying to set a unique id in the template and use it after the data source gets loaded.  All the code "works" to the point of trying to create the guage.  But I just can't tell if the id is really getting set in the template and the selector is selecting it when I try to create it.  Can this be done?  Maybe I'm just doing it wrong?



    <script type="text/x-kendo-template" id="reportPackageCountTemplate">
        <a data-role="listview-link" href="\#listPackageCompanyView?id=#:PackageID#">
        Pkg #= PackageID #
        <br />
        <p id="pctFullGuage#:PackageID#" class"pctFullGuage">test:#= PackageID #</p>
    </script>

  var dsPackageData = new kendo.data.DataSource({
      schema: {
          model: PackageData
      },
      transport: packageDataTransport,
      sync: function (e) {
          window.app.navigate("#packageListView");
      },
      error: function (e) {
          alert("dsPackageData error: " + e.status + "errorThrown: " + e.errorThrown);
      },
      change: function (data) {
          InitPctFullGauge();
      }
  });

  function InitPctFullGauge() {
      var total = dsPackageData.total();
      if (total > 1) {
          var gaugeConfig = {
              pointer: {
                        value: 1
              },
              scale: {
                  min: 1,
                  max: 100,
                        vertical: false
              }
          }

          for (var i = 0; i < total; i++) {
              editPackageData = dsPackageData.at(i);
              gaugeConfig.pointer.value = editPackageData.PercentFull;
              $("#pctFullGuage" + editPackageData.PackageID).kendoLinearGauge(gaugeConfig);
          }
      }
  }

EDIT: After some further testing it seems one problem is that the change event is called and my function runs before the html is rendered with the list, so the id's are not there when the function executes.  I have examined the page source of the rendered list and the id's are there as I expect.  From that it seems I need a way/event to let me know when the listview has been rendered into html and then run my function to render the guages.  Is there anything like that?  Or do I just need to use a document ready function and look only for this one page?  Or some other way?  Thanks.
Alexander Valchev
Telerik team
 answered on 13 Feb 2013
3 answers
648 views
I was wondering if maybe someone could help me get the syntax correct to format the DateTime values on my CategoryAxis? Currently, the closest I have gotten throws an InvaidCastException, but my value is definately a datetime datatype. Any help will be appreciated, my code is below:

HomeController.cs:
using MobileChart_WithDataBind.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
 
namespace MobileChart_WithDataBind.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            var myHist = new List<ChartHist>
            {
                new ChartHist() { LoginDateTime = Convert.ToDateTime("2/6/2013 12:00:00"), LoginDuration_Fail = 3, LoginDuration_Pass=2 },
                new ChartHist() { LoginDateTime = Convert.ToDateTime("2/5/2013 12:00:00"), LoginDuration_Fail = 4, LoginDuration_Pass=2 },
                new ChartHist() { LoginDateTime = Convert.ToDateTime("2/4/2013 12:00:00"), LoginDuration_Fail = 3, LoginDuration_Pass=2 },
                new ChartHist() { LoginDateTime = Convert.ToDateTime("2/3/2013 12:00:00"), LoginDuration_Fail = 3, LoginDuration_Pass=2 }
            };
 
            return View(myHist);
        }
 
        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";
 
            return View();
        }
 
        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";
 
            return View();
        }
    }
}

Index.cshtml:
@model IEnumerable<MobileChart_WithDataBind.Models.ChartHist>
 
@{
    ViewBag.Title = "Home Page";
}
@(Html.Kendo().Chart(Model)
            .Name("chart")
            .Title("Chart Title")
            .SeriesDefaults(seriesDefaults => seriesDefaults.Column().Stack(false)
            )
            .Series(series =>
            {
                series.Column(model => model.LoginDuration_Pass).Name("Passed").Color("Lime");
                series.Column(model => model.LoginDuration_Fail).Name("Failed").Color("Red");
            })
            .CategoryAxis(axis => axis
                .Categories(model => model.LoginDateTime)
                .Title("Time of Attempt")
                .Date()
                .Labels(labels => labels
                    .DateFormats(formats => formats.Hours("HH:mm"))
                    )
            )
            .ValueAxis(axis => axis
                .Numeric().Labels(labels => labels.Format("{0:0.00}"))
                .Title("Seconds")
            )
            .Tooltip(tooltip => tooltip
                .Visible(true)
                .Format("{0} Seconds")
            )
            )
<h2>@ViewBag.Message</h2>
<p>
    To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc<;/a>.
</p>
 
<ul data-role="listview" data-inset="true">
    <li data-role="list-divider">Navigation</li>
    <li>@Html.ActionLink("About", "About", "Home")</li>
    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>
Daniel
Telerik team
 answered on 13 Feb 2013
1 answer
142 views
Hi!

I am not sure on how will I explain this.
I have a list of all the nearest addresses from a web sql and it has a specific view/template to show a single address. My case is that it is caching the first address that I am choosing. It is a sort of caching but I want to clear the content and show the other addresses into that specific view/template. I hope you've got what I mean.

Here is an example

List view:

<script type="text/x-kendo-template" id="addresses-listview-template">
        <a class="clear" data-role="listview-link" href='views/address.html?id=${id}'>${name}</a>
    </script>
    
    <!--page-addresses-->
    <div data-role="view" id="page-addresses" data-title="Addresses" data-init="getAddressesInit" data-before-show="addressesBeforeShow">
        <ul data-role="listview" data-style="inset" data-type="group">
            <li>
                <ul id="addresses-listview" data-role="listview" data-template="addresses-listview-template" data-auto-bind="false">
                    
                </ul>
            </li>
        </ul>
    </div>

Single View (Second hit will cache the first hit)

<script type="text/x-kendo-template" id="address-single-template">
        <h1>#= name #</h1>
        <p>Address: #= address #</p>
    </script>
    
    <!--page-address-->
    <div data-role="view" id="page-address" data-title="Address" data-init="getAddressInit">
        <ul id="address-single-view" data-template="address-single-template">
        
        </ul>
        <div id="map_canvas_address"></div>
    </div>

Thanks!
James
James
Top achievements
Rank 1
 answered on 13 Feb 2013
1 answer
248 views
Can you advice me, how to disable default selection in ListView in Chrome browser? When I open ListView in Chrome, the first item of ListView is selected by default. I was trying to call clearSelection on object created this way:
gListView = $("#listView").kendoListView({
    selectable: true,
    navigatable: true,
    dataSource: gDrawDataListView,
    template: kendo.template($("#template").html())
});
but when I was trying to call
gListView.clearSelection();
the object did not have this method.
What am I doing wrong?
Iliana Dyankova
Telerik team
 answered on 13 Feb 2013
3 answers
2.0K+ views
Hi,

I want that the chart to be re sized based following the browser window. I tried this code but it does not work:

jQuery(window).resize(function () {
                        control.kendoChart.refresh();
                    });
The biggest problems I have is in decreasing the size as it breaks my page layout, increasing the size keep the layout but the chart is not re sized either

I've seen possible solutions like http://www.telerik.com/community/forums/aspnet-mvc/chart/resizing-chart-on-browser-resize.aspx
but this does not work in my case as I do not have a prefixed size.

Thank for your help,
Ignacio
Iliana Dyankova
Telerik team
 answered on 13 Feb 2013
8 answers
393 views
Hi kendo users!

I have a problem with the filter on this grid:

grid declaration:
                $("#grid2").kendoGrid({
                    dataSource: {
                        transport: {
                            read: "datos/CargarTipo_Impresion_s.php" //php file with mysql sentence
                        },
                        batch: true,
                        schema: {
                            model: {
                                id: "notipoimpresion",
                                fields: {
                                    notipoimpresion: { type: "number" },
                                    descripcion: { type: "string" },
                                    nogrupo: { type: "number" },
                                }
                            }
                        },
                        //send notipoimpresion like parameter to the page : CargarTipo_Impresion_s.php
                        serverFiltering: true,
                        //filter: { field: "notipoimpresion", operator: "eq", value: "1,2" }, // with this filter is ok, show data
                        //filter: { field: "notipoimpresion", operator: "eq", value: 2 }, //with this filter is ok , show data
                        //filter: { field: "notipoimpresion", operator: "eq", value: '1,2' }, //with this filter is ok, show data

                        filter: { field: "notipoimpresion", operator: "eq", value: value_codigos_tipo_impresion }, //with this filter doesn´t show data
                        //value_codigos_tipo_impresion, can have this values: "1" or "1,2" or "1,2,4", etc.
                       //value_codigos_tipo_impresion, receive the value from a form text

in CargarTipo_Impresion_s.php use this:
$codigos_tipo_impresion = mysql_real_escape_string($_REQUEST["filter"]["filters"][0]["value"]);
and the execute a mysql sentence

Could someone tell me, why doesn´t make the filter ? or what is wrong?

Thanks
JC
JC
Top achievements
Rank 1
 answered on 13 Feb 2013
1 answer
137 views

When doing "Range selection" with the DateTimePicker, I think I've found a bug:

  1. Go to http://demos.kendoui.com/web/datetimepicker/rangeselection.html
  2. Clear BOTH pickers
  3. Click the calendar icon in the Start date control
    1. Defaults to this month, but no days are displayed for picking
  4. In the Start date picker, type in 2/11/2012 (or today's date) and press ENTER
  5. In the End date picker, use the calendar icon to pick today's date

An entire month is added to the value in End date. For instance, picking toaday's date of 2/11/2012, the End date is actually set to 3/11/2012. Is this a Bug?

 

Georgi Krustev
Telerik team
 answered on 13 Feb 2013
1 answer
59 views
Hello,

Are there any plans to provide MVC based server side wrappers for Kendo UI Mobile like those available for Web and DataViz?

Thx...Bob Baldwin
Trabon Solutions
Devcraft Complete Licensed Users
Dimo
Telerik team
 answered on 13 Feb 2013
2 answers
3.2K+ views
Good day,

I have the following scenario:
By default, the grid on my page loads data that is grouped by 4 fields.

The user has the ability to add or remove a grouping if he chooses to. I want to have a button on my page that resets the view to how it was when the page loaded, with the data grouped by the 4 fields.

I want to do this without reloading the page itself, because the call that returns the data takes too long unfortunately. How do I programatically group by a certain field (or group of fields) on the click of the reset button?

Anyone have any ideas?
Hennie
Top achievements
Rank 1
 answered on 13 Feb 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
Drag and Drop
Application
Map
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
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?