Telerik Forums
Kendo UI for jQuery Forum
5 answers
269 views
Hello,

I've recently updated to the latest build of Kendo Mobile.

I have been working on integrating the mobile framework into a CMS that has a dynamically generated navigation and objects. One of the things I am struggling with the most is the use of hashtags within the URL's.

For example:
I have a dynamic navigation that outputs the tabstrip nav like this:

<div data-role="footer">
                <div data-role="tabstrip" id="custom-tabstrip">
                <a href="/" data-icon="home">Home</a>
                 
               <a href="/gallery/" data-icon="camera">Gallery</a>
                 
               <a href="/blog/" data-icon="compose">Blog</a>
                 
               <a href="/contact/" data-icon="globe">Contact</a>
                 
               <a href="?mobileFormat=false" data-icon="action">Full Site</a>
                </div>
</div>
Each href is a dynamic page generated by the CMS. Unfortunately, whenever a link is clicked, Kendo insists on adding a hashtag in the URL, thinking it's a local view (i.e. http://kendo.themodmedia.com/#/gallery). I've even tried using absolute URL's in the href and the output is like this: http://kendo.themodmedia.com/#/http://kendo.themodmedia.com/gallery.

Is there a way to tell Kendo that if the href does not start with a hash tag, then it is not a local view?

Another example is that the CMS contact form outputs a string appended to the URL when the form is submitted. Something like
"?nocache=1#form1234567890" which jumps to a div of that id that displays the form response (i.e. "Thank you!"). The problem is that because that hash tag is in the URL, Kendo tries to load it as a local view, which doesn't exist.

Is there a global way to tell Kendo "If the div contains a data-role of "view" try to load a view; if not, just behave normally"? It just seems like Kendo is trying to force everything into a view and forgets that hash tags are still used for other things within a website.

Here is the demo site: http://kendo.themodmedia.com?mobileFormat=true (once the URL is loaded, you can remove the ?mobileFormat=true string).

Thanks!
Ronnie
Alexander Valchev
Telerik team
 answered on 21 Feb 2013
1 answer
321 views
Hi,

How can we bind the Knockout observable array into the kendo treeview?

I am glad to know both the ways, Bindng the knockout observable array directly into the knedo treeview if possible
and convertng the knockout observable array into kendo hierarchical data and then binding into the kendo treeview if first option is not possible.

Is it possible to provide a sample application?

Thanks,
Mallappa
Atanas Korchev
Telerik team
 answered on 21 Feb 2013
1 answer
281 views
I have a editable grid (inline) that contains a currency field, in pt-BR culture.

When I'm adding a new row, if I put the value 0,23 for example, and click Update, the grid now shows the value R$ 23,00.

How can I correct that bug? I've already checked if the culture script is set properly...

Here is my code (AdditionalPrice is the field)

var dataSource = new kendo.data.DataSource({
            transport: {
                read: "/Product/OptionGridRead",
                update: {
                    url: "/Product/OptionGridUpdate",
                    type: "POST"
                },
                destroy: {
                    url: "/Product/OptionGridDestroy",
                    type: "POST"
                },
                create: {
                    url: "/Product/OptionGridCreate",
                    type: "POST"
                }
            },
            schema: {
                model: {
                    id: "Id",
                    fields: {
                        Name: { validation: { required: true } },
                        AdditionalPrice: { type: "number", validation: { required: true } },
                        IsDefault: { type: "boolean" }
                    }
                }
            }
        });

        $("#grid").kendoGrid({
            height: 190,
            width: 200,
            dataSource: dataSource,
            toolbar: ["create"],
            columns: [
                { field: "Name", title: "Nome", editable: true },
                { field: "AdditionalPrice", title: "Valor Adicional", format: "{0:c2}", width: "150px" },
                { field: "IsDefault", title: "PadrĂ£o", width: "100px", template: '<input type="checkbox" name="IsDefault_#= id #" value="#= id #" id="IsDefault_#= id #" disabled="disabled" ${IsDefault==true?"checked":""} />'},
                { command: ["edit", "destroy"], title: " ", width: "210px" }],
            editable: {
                mode: "inline",
                createAt: "bottom"
            },
        });
Alexander Valchev
Telerik team
 answered on 21 Feb 2013
1 answer
129 views
i need to generated a simple line chart using an array generated from form value calculations. What is the best way to accomplish this.  I tried the bind to local data, but I don't know how to update the local data based on the array calculations.
PHP array
Array
(
    [0] => Array
        (
            [name] => 0.1
            [value] => 422.19
        )

    [1] => Array
        (
            [name] => 0.2
            [value] => 256.77
        )

    [2] => Array
        (
            [name] => 0.4
            [value] => 143.96
        )...
bound local data
                var windowSizeMbs = [
                    {
                        "country": "United States",
                        "rtt": "0.1mS",
                        "value": 108.81
                    },
                    {
                        "country": "United States",
                        "rttms": "0.2mS",
                        "value": 100.47
                    },
                    {
                        "country": "United States",
                        "rttms": "0.4mS",
                        "value": 87.11
                    },.....

John
Top achievements
Rank 1
 answered on 21 Feb 2013
1 answer
120 views
I have a treeview that I bind on the server using MVC. The user can add nodes to the tree through the interface. I would like to have a button that sends the resulting tree back to the controller after the user has completed the changes. How do I do this?

Please respond quickly as I have a very short timeline and I have been pushing Kendo on my clients. I don't want to let my clients down.

Thanks,

Mark
Petur Subev
Telerik team
 answered on 21 Feb 2013
1 answer
248 views
Hi I have a project (which we are using Kendo on in evaluation for purchasing dev licensing) that I want my axis values to be 0%-100%. I have tried changing the numeric labels but all I seem to be doing is changing formatting and not the actual range. I have read through the documentation and haven't found a place where the is set except for the stock type charts with the crossover axis information. I also want to make it to where if a bar in a series is above a certain level it is a different color. This forum hinted that the feature was coming http://www.kendoui.com/forums/dataviz/chart/chart-color.aspx but didn't make it clear that it landed for MVC as I don't want separate series. For instance anything above 85% would be green and anything below would be red.

Here is the code for my chart:

<div class="chart-wrapper">
    @(Html.Kendo().Chart()
        .Theme("metro")
        .Name("satisfactionChart")
        .Title("Customer Satisfaction")
         
        .Legend(legend => legend
            .Position(ChartLegendPosition.Bottom)
        )
        .Series(series => {
            series.Bar(new double[] { 94, 82, 89, 95, 90, 80, 91 }).Name("Key Performance Metrics").Color("#00CD00");
        })
         
        .CategoryAxis(axis => axis
            .Categories("Ease of requesting help", "Time to reach qualified technician", "Time to provide a solution", "Completeness of solution", "Technical ability & product knowledge", "How well we kept you informed", "Overall opinion of service")
        )
 
        .ValueAxis(axis => axis
            .Numeric().Labels(labels => labels.Format(""))
            .PlotBands(plotBands => plotBands
            .Add().From(86).To(95).Opacity(.3).Color("Grey")
            )
        )  
          
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Format("{0}%")
        )
    )
</div>

I would really appreciate help with this. Thanks.
Iliana Dyankova
Telerik team
 answered on 21 Feb 2013
3 answers
559 views
I'd like to add in the right center and left center position of the scrollview container two arrows that help the user to navigate to the next or the previous image.
I tried with two <div> element using position:absolute and background image to have the two arrow in the desired position, but as you can see in the attached file, the arrows will disappear after the first scroll to the right. I need a <div> element overlying with the scrollview container.
Is it possibile to get the desired effect?

Thank you
Alexander Valchev
Telerik team
 answered on 21 Feb 2013
1 answer
199 views

Hi,

What I am trying to do :

1)I have a form with Kendo UI controls like DatePicker(s), Dropdownlist(s), NumericTextBox(s) on the first half of the page
2)Second half has a Kendo UI MVC Grid control
  a) This Kendo UI Grid control has 8 columns in which 2 columns has a Kendo dropdownlist(EditorTemplate) and CheckBox(EditorTemplate).
  b) The Kendo UI Grid control is Ajax binding.
3) When the save button is clicked, all the values from the Kendo UI controls(first half) and Kendo UI grid control(second half) together
   are posted as a Json object via "Ajax Post" to the controller.
4) I am using Model binding for the above process

Issues or the problem I am facing :
1) The first half of the form with other Kendo UI controls are posting their values properly to the controller, but where as
   the Kendo UI Grid is having some problems posting some column values
  
   a) The columns in the Kendo UI Grid with the datatype decimal is not posting the values
   b) The EditorTemplate controls like the CheckBox and the kendo dropdown when selected shows the values "[Object Object]" for dropdownlist
      and the actual value of the boolean rather than the checkbox control.
  
Here is the project and attaching the same.
Please refer the /Views/Index view page for the above mentioned.

Daniel
Telerik team
 answered on 21 Feb 2013
1 answer
189 views
Hi,

I have a requirement where shortYearCutOff has to be 29, but its hardcoded as 30 in Kendo UI.

 $("#sampleDate").kendoDatePicker({
    format: "MM/dd/yyyy",
    parseFormats: ["MMddyy"]
});

Here is the condition how it works:
If yy <= zz, then automatically substituted by year 20YY
If yy > zz, then automatically substituted by year 19YY
Where zz – shortYearCutOff (it’s a local variable which is used in function parseExact())

Input

Output

Expected Output where shortYearCutOff=29

031329
031330
031331
031332

03/13/2029
03/13/2030
03/13/1931
03/13/1932

03/13/2029
03/13/1930
03/13/1931
03/13/1932


Thanks
Nishad.
Georgi Krustev
Telerik team
 answered on 21 Feb 2013
1 answer
190 views
I have a kendo grid implemented with popup editing. I wired up a function to the save event so that when the user clicks 'Update' an ajax request is made. I'm trying to find a way to cancel the update and not add the new or updated data if the request returns an error.

options.save = function (e) {
    widget.save.call(viewModel, e.model.toJSON(), function () {
        e.preventDefault();
    });
};

The save function being called makes a $.post() request and if the response comes  back with an error it will fire the callback passed to save.
I have noticed that as soon as an ajax call is made the edit popup is closed and the data appears in the grid even though the ajax call hasn't been returned yet.  This led me to return a jquery deferred in my function,  but regardless of the deferred the changes are still saved to the grid before the deferred is returned.

How can I cancel the save event so that all changes that I've made to the data are reversed?

widget.options.save = function (e) {
    $.when(widget.save.call(viewModel, e.model.toJSON())).then().fail(function () {
        kendoGrid.cancelChanges();
    });
};
function save (item) {
var url = constants.handlerUrl + 'action=save';
var data = JSON.stringify(item);
var deferred = $.Deferred();

return $.post(url, data).pipe(function(data, textStatus, jqXHR) {
var deferred = $.Deferred();
data = ko.utils.parseJson(data);

if (data.error) {
return deferred.reject();

var location = ko.utils.arrayFirst(self.locations, function (item) {
return item.id == data.id;
});
location.zipCodes(data.zipCodes);

return deferred.resolve();
});
};
Vladimir Iliev
Telerik team
 answered on 21 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
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
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
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?