Telerik Forums
Kendo UI for jQuery Forum
0 answers
72 views
hey all 
ive got a dataseries here which looks like this

[{"MDetail":"Actual","Amount":2077015154,"Month":"Jan","Monthnum":1,"Year":2011,"d":"2011-1-1"},{"MDetail":"Budget","Amount":1993934548,"Month":"Jan","Monthnum":1,"Year":2011,"d":"2011-1-1"},{"MDetail":"Budget","Amount":2037512363,"Month":"Feb","Monthnum":2,"Year":2011,"d":"2011-2-1"},{"MDetail":"Actual","Amount":2079094248,"Month":"Feb","Monthnum":2,"Year":2011,"d":"2011-2-1"},{"MDetail":"Budget","Amount":2060363670,"Month":"Mar","Monthnum":3,"Year":2011,"d":"2011-3-1"},{"MDetail":"Actual","Amount":2081175424,"Month":"Mar","Monthnum":3,"Year":2011,"d":"2011-3-1"},{"MDetail":"Budget","Amount":2020760922,"Month":"Apr","Monthnum":4,"Year":2011,"d":"2011-4-1"},{"MDetail":"Actual","Amount":2083258683,"Month":"Apr","Monthnum":4,"Year":2011,"d":"2011-4-1"},{"MDetail":"Budget","Amount":2043637146,"Month":"May","Monthnum":5,"Year":2011,"d":"2011-5-1"},{"MDetail":"Actual","Amount":2085344027,"Month":"May","Monthnum":5,"Year":2011,"d":"2011-5-1"},{"MDetail":"Budget","Amount":2024808514,"Month":"Jun","Monthnum":6,"Year":2011,"d":"2011-6-1"},{"MDetail":"Actual","Amount":2087431458,"Month":"Jun","Monthnum":6,"Year":2011,"d":"2011-6-1"},{"MDetail":"Budget","Amount":2026835350,"Month":"Jul","Monthnum":7,"Year":2011,"d":"2011-7-1"},{"MDetail":"Actual","Amount":2089520979,"Month":"Jul","Monthnum":7,"Year":2011,"d":"2011-7-1"},{"MDetail":"Budget","Amount":2070696466,"Month":"Aug","Monthnum":8,"Year":2011,"d":"2011-8-1"},{"MDetail":"Actual","Amount":2091612592,"Month":"Aug","Monthnum":8,"Year":2011,"d":"2011-8-1"},{"MDetail":"Actual","Amount":2093706298,"Month":"Sep","Monthnum":9,"Year":2011,"d":"2011-9-1"},{"MDetail":"Budget","Amount":2114643361,"Month":"Sep","Monthnum":9,"Year":2011,"d":"2011-9-1"},{"MDetail":"Actual","Amount":2095802100,"Month":"Oct","Monthnum":10,"Year":2011,"d":"2011-10-1"},{"MDetail":"Budget","Amount":2137718142,"Month":"Oct","Monthnum":10,"Year":2011,"d":"2011-10-1"},{"MDetail":"Actual","Amount":2097900000,"Month":"Nov","Monthnum":11,"Year":2011,"d":"2011-11-1"},{"MDetail":"Budget","Amount":2118879000,"Month":"Nov","Monthnum":11,"Year":2011,"d":"2011-11-1"},{"MDetail":"Actual","Amount":2100000000,"Month":"Dec","Monthnum":12,"Year":2011,"d":"2011-12-1"},{"MDetail":"Budget","Amount":2079000000,"Month":"Dec","Monthnum":12,"Year":2011,"d":"2011-12-1"}]

the chart works great
EXCEPT: feb, oct and nov drop down to 0
and dec doesnt even show up

which is odd since all the other months look great
and the data looks consistent

any ideas?

you can see the chart here:
www.the-agora.com

toy
Top achievements
Rank 1
 asked on 22 May 2013
2 answers
55 views
hi
i have a dataSource that spits out data like this:
 
after feb - the 'budget' MDetail falls off to 0
and before jun - i dont know what the 'projected' MDetail does
its drawing a bunch of stuff
 
what im trying to achieve here is:
if there are no records for anything after feb
then dont draw anything - just cut it off
ie dont descend to 0
 
and likewise if there are no records for the beginning
then dont draw anything until theres a record for the category
ie it iwll be blank until jun and then the 'projected' numbers start drawing
 
how do i do this?
 
thanksa!

[{
Amount: "2140402000"
MDetail: "Budget"
Month: "Jan"
Monthnum: "1"
Year: "2013"
},
{
Amount: "2146823206"
MDetail: "Budget"
Month: "Feb"
Monthnum: "2"
Year: "2013"
},
{
Amount: "2257798847"
MDetail: "Projected"
Month: "Jun"
Monthnum: "6"
Year: "2013"
},
{
Amount: "2272474540"
MDetail: "Projected"
Month: "Jul"
Monthnum: "7"
Year: "2013"
}]

and the chart markup looks like htis
$J("#chart").kendoChart({
    dataSource: {
        data:source,
        group: {
            field: "MDetail",
            dir: "asc"
        },
        sort: [
            {field: "Year", dir: "asc"},
            {field: "Monthnum", dir: "asc"}
        ]
    },
    theme: "blueOpal",
    title: {
        text: "Total Cost of Workforce for " + year
    },
    legend: {
        position: "bottom"
    },
    seriesDefaults: {
        type: "area",
        format: "${0:0,000}"
    },
    series: [{
        field: "Amount",
        groupNameTemplate: "#= group.value # "
    }],
    valueAxis: {
        labels: {
            template: "#= kendo.format('$ {0:N0}', value / 1000000) # M"
        },
        majorUnit: 100000000,
        line: {
            visible: false
        },
        axisCrossingValue: -10
    },
    categoryAxis: {
        field: "Month",
        majorGridLines: {
            visible: false
        }
    },
    tooltip: {
        visible: true,
        format: "$ {0:0,000}"
    }
});


toy
Top achievements
Rank 1
 answered on 22 May 2013
2 answers
74 views
Hello!

I have chart with 2  axes.
Prior to data being pumped  into chart those 2 axes looked really jammed (see attach).
Once data is bound and chart is ploatted in looks perfect.  

Any recommendations how can I avoid  this creepy UI effect?

Here is chart definition:

 $("#chartISPbar").kendoChart({
                    title: {
                        text: "ISP latency and user distribution"
                    },
                    dataSource: ispDataSource,
                    autoBind: false,
                    legend: {
                        position: "bottom"
                    },
                    chartArea: {
                        background: ""
                    },
                    seriesDefaults: {
                        type: "bar"
                    },
                    series: [{
                        name: "AVG responce time",
                        field: "AVG_ISP_ResponseTime",
                        axis: "responses"
                    },
                            {
                                name: "Number of requests",
                                field: "NumberOfRequests",
                                axis: "requests"
                            }

                    ],
                    categoryAxis: {
                        field: "ISP",                      
                        majorGridLines: {
                            visible: false
                        }

                    },
                    valueAxes: [
                        {
                            name: "responses",
                            title: { text: "latency (response time)" }
                        },

                    {
                        name: "requests",
                        title: { text: "users (# requests)" }

                    }
                    ],
                    tooltip: {
                        visible: true,
                        format: "N0",                    
                        template: "#= series.name #: #= value #",
                        padding: {
                            left: 100
                        }
                    }
                });

KendoUI ver: 2013.1.319
Browsers: FireFox 20.0.1, Chrome 26.0.1410.64 m
Olga
Top achievements
Rank 1
 answered on 22 May 2013
5 answers
367 views
I have a grid with an edit template specified and withing that grid I'm trying to use either render partial or renderaction. Both i've gotten to work with the actually editing and adding that is not my problem. The problem is the data for my partial inside my edittemplate is not being populated with data. Here is my edit template.

@model <BaseFormModel>
@{
    Model.Demographics = Model.GetFormDemographics(Model.PlanActivityId, Model.Id, 0);
}
<div class="modalContent">
    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)
 
        <fieldset>
            <legend>Edit Events</legend>
            <div>
                <label>Month</label>
                @Html.TextBoxFor(model => model.StartMonth, new { @placeholder = "mm" })/@Html.TextBoxFor(model => model.StartYear, new { @placeholder = "yyyy" })
            </div>
            <div>
                <label>Event Name</label>
                @Html.TextBoxFor(m => m.FormName)
            </div>
            <div>
                <label>Number of brochures distributed(if applicable)</label>
                @Html.TextBoxFor(m => m.Count2, new { @maxlength = 3 })
            </div>
            <div>
                <label>Number of attendees</label>
                @Html.TextBoxFor(m => m.Count, new { @id = "txtNumberOfAttendees" })
            </div>
            <a id="autoPopulate">Populate based on my county census and number of attendees.</a>
            <h2>Target Demographics</h2>
            @*@{
        Html.RenderAction("GetFormDemographics", "Form", new { planActivityId = ViewBag.PlanActivityId, formId = Model.Id, spUserId = 0 });
            }*@
            @{
                Html.RenderPartial("_PartialDemographicsEditor",model: Model.Demographics);
            }
        </fieldset>
    }
</div>
How do I get my renderpartial or renderaction to work or is there some other way to use partials in kendo edittemplates for grids.
Petur Subev
Telerik team
 answered on 22 May 2013
1 answer
261 views
I have a viewmodel that binds a strongly typed model to the view's controls:

Example: <input type="text" placeholder="Address 1" id="CurrentAddress1" data-bind="value: account.CurrentAddress.Address1"> and <input type="text" placeholder="Address 1" id="PermanentAddress1" data-bind="value: account.PermanentAddress.Address1">

I need functionality, that if a checkbox for "Same As" is checked, the Permanent values in other controls get copied over from the Current values as the user enteres them.

Seems that I need to override either the dataSource or the model bindings, but as a new Kendo developer I am wondering how this would be possible. THanks!
Petur Subev
Telerik team
 answered on 22 May 2013
4 answers
238 views
Welcome. I tested PHP wrappers for KendoUI. I found a problem / bug.

If you use AutoComplete control to retrieve data about the elements, such as a telephone, social security number, tax ID, ID, ID card number, barcode, etc are DataSourceResult-> Read () does not return any result.
The problem is the WHERE clause.

private function where($properties, $filter, $all) {
    if (isset($filter->filters)) {
        $logic = ' AND ';
 
        if ($filter->logic == 'or') {
            $logic = ' OR ';
        }
 
        $filters = $filter->filters;
 
        $where = array();
 
        for ($index = 0; $index < count($filters); $index++) {
            $where[] = $this->where($properties, $filters[$index], $all);
        }
 
        $where = implode($logic, $where);
 
        return "($where)";
    }
 
    $field = $filter->field;
 
    if (in_array($field, $properties)) {
        $index = array_search($filter, $all);
 
        $value = ":filter$index";
 
        if ($this->isDate($filter->value)) {
            $field = "date($field)";
            $value = "date($value)";
        }
 
        if ($this->isString($filter->value)) {
            $operator = $this->stringOperators[$filter->operator];
        } else {
            $operator = $this->operators[$filter->operator];
        }
 
        return "$field $operator $value";
    }
}
Should pay attention to excerpt:
if ($this->isString($filter->value)) {
                $operator = $this->stringOperators[$filter->operator];
            } else {
                $operator = $this->operators[$filter->operator];
            }
At the time of transmission by the AutoComplete type information '90080800418 '(Social Security) is used in an incorrect set of operators.

private $stringOperators = array(
        'eq' => 'LIKE',
        'neq' => 'NOT LIKE',
        'doesnotcontain' => 'NOT LIKE',
        'contains' => 'LIKE',
        'startswith' => 'LIKE',
        'endswith' => 'LIKE'
    );
private
$operators = array(
        'eq' => '=',
        'gt' => '>',
        'gte' => '>=',
        'lt' => '<',
        'lte' => '<=',
        'neq' => '!='
    );
The indicator provides information and an operator that has been used is startswith is not in the $operators.
{"filter":{"logic":"and","filters":[{"value":"90080800418","operator":"startswith","field":"kh_Imie","ignoreCase":true}]}}
I leave the matter to think about. It was enough to add operators to the $operators, but it is possible that you will want to develop something else.


Paweł Kasztelan
Top achievements
Rank 2
 answered on 22 May 2013
10 answers
1.0K+ views
Is there any way to programmatically scroll the listview to the top?
I have a listview where I change the contents dynamically and afterwards I would like to scroll to top.
Ryan
Top achievements
Rank 1
 answered on 22 May 2013
1 answer
459 views
In  my case of Kendo grid, datasource is from JSON data. and part of data feed is like following:
"User": {
...
"FirstName": "Joe",
"LastName": "Doe",
"Phone": null,
...
}

And I need to display full name  in column of "Name" in kendo grid
  columns: [
                { field: "User.FirstName+' '+ User.LastName", title: "Name"},
                ...
   ]
and I also set sortable to be true for this grid. And that works well, the grid shows cell as "Joe Doe"

However, the grid doesn't sort by "Name" column and when I tried to click header of column "Name",  it returns error on kendo.core.min.js 
"(function($,undefined){function Class(){}function compilePart(e,t){if(t)return"'"+e.split("'").join("\\'").split('\\"')......."

Could you let me know where I did wrong? Thanks,


Dimo
Telerik team
 answered on 22 May 2013
1 answer
118 views
I am looking for an example of using Kedo Upload, and placing the file/metada in an ODATA data service.

Ideally I would like to relate it to another parent record as well.

Thanks in advance.


T. Tsonev
Telerik team
 answered on 22 May 2013
2 answers
92 views
Hi! I have a problem with iPhone 5 scrolling -- in the simulator after a couple of minutes, I can't scroll. On an iPhone 5, it stops scrolling immediately when the job list loads.

Am I loading the list in a way that could cause it to stop scrolling (show vs init)? Should I scrollview instead of listview? Anyone else having this issue? Is there a fix?

Gist of example

All of the buttons in the layout work perfectly fine, and you can click / tap on the items in the jobsList -- but you just can't scroll the jobslist.
Alexander Valchev
Telerik team
 answered on 22 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?