Telerik Forums
Kendo UI for jQuery Forum
2 answers
123 views
Hello, Is it possible to load modalview content form a remote link, the same way you would use a Kendo Window? I'm trying to achive this, I set the href of my button as simply a remote link (no #), but its not working. it gives Uncaught Error: Syntax error, unrecognized expression: /WebUI/Account/Login So basicly it doesnt recognize the link?
Pete
Top achievements
Rank 1
 answered on 30 Jan 2013
1 answer
101 views
I am trying to get my grid filter drop downs bound to my data sources by following the demos but my ui functions are not getting called.

I have cut things down to the smallest subset of data I can and still my filters are just the stock ones and my functions never seem to get triggered.

$("#searchResults").kendoGrid({
            dataSource: seachResultsDataSource,
            filterable: {
                extra: false,
                operators: {
                    string: {
                        startswith: "Starts with",
                        eq: "Is equal to",
                        neq: "Is not equal to"
                    }
                }
            },
            columns : [                   
                    {
                        title: "Area",                       
                        field: "AreaID",
                        filterable: {
                            ui: areaFilter
                        }
                    }]
});
 
// Never gets called.
function areaFilter(element) {  
    kendoHelper.BindDropDownList(element, dataSources.areaDataSource);
}
The helper function used works perfectly everywhere else I use it and as it is break points indicate the areaFilter is never called to do anything anyway.  Is there some obvious error in this?  Futher - when I do just enter data into the type in box it doesn't get sent to the web server, only the paging options make it, the filters are lost somewhere along the way.
Travis
Top achievements
Rank 1
 answered on 30 Jan 2013
1 answer
156 views
Hello.
When I define a Chart for the first time, I put the Action Name, Controller Name and Route Values:
.DataSource(datasource => datasource
.Read(read => read.Action("DataForEvo", "Home", new { seriename = "Default", category = "Default" }))
But later, I need to reload the chart with new 'route values':
I have 2 charts in the same page, at the bottom a "Bar Chart", and at the top a "Line Chart", when the user click any serie of the Bar Chart, the Line Chart should be updated with relative data.

In the "Bar Chart" I have the Series Click event:
 
.Events(ev => ev.SeriesClick("onSeriesClick")))

where I can capture the serie name, category and value. From here using jquery I can capture the chart
var Chart = $("#chart").data("kendoChart");

maybe exist a method or way to call again the action with new 'route values'.

Many Thanks.
Petur Subev
Telerik team
 answered on 30 Jan 2013
12 answers
410 views
Hello,
i have a dropdown above the chart with products,and in the chart it shows the quantity per several years.
when i change the dropdown,in the change event,i call the jquery function $.Get(/GetProducts",{productID:$("#category").val()})

and in the controller the action:
private ActionResult GetProducts(int? productID)
{
var products=_productSalesRepository.GetAll().Where(x=>x.ProductID==(productID ?? 1));
return Json(result,JsonRequestBehaviour.AllowGet);
}
products are something like [{ProductID:1},{Year:1997},{Quantity:40}],[{ProductID:1},{Year:1998},{Quantity:50}]

but the problem is that the chart doesn't refresh and draw new bars,acording to the new values.I can confirm that, the action is called,and return the new set of data.
How can i do this to work?

Regards,
Daniel
Daniel
Top achievements
Rank 1
 answered on 30 Jan 2013
1 answer
661 views
Hi,

Is there a way enable two way binding on template referenced in MVVM binding context. I am looking to bind value of radio button to the value of the View Model.

Thanks
<form id="my-form" class="k-content">
        <ul id="pb" data-expand-mode="single" data-role="panelbar">
          <li class="k-state-active">
            <span class="k-link k-state-selected">Step 1</span>
            <div class="k-content">
              <div data-bind="text:name"></div>
              <ul data-template="row-template" data-bind="source: Reports">
              </ul>
            </div>
          </li>
        </ul>
    </form>
    <div id="view-model-state"></div>
    <script id="row-template" type="text/x-kendo-template">
        <li><span data-bind="text:Name"></span><input name="report" type="radio" data-bind="value:Value"/></li>
    </script>
MyApp.Ds = new function() {
  var self = this;
  self.Reports = [
    {Name: "R1", Value: 1},
    {Name: "R2", Value: 2},
    {Name: "R3", Value: 3},
  ];
};
 
MyApp.ViewModel = (function(){
  var vm = kendo.observable({
    name: "Nested Template Test",
    Reports: MyApp.Ds.Reports,
    Report: ""
  });
  vm.bind("change", function(e) {
      $("#view-model-state").html(JSON.stringify(vm.toJSON()));
    //console.log("change", vm.toJSON());
  });
  vm.bind("set", function(e) {
      $("#view-model-state").html(JSON.stringify(vm.toJSON()));
    //console.log("set", vm.toJSON());
  });
  return vm;
})();
 
$(function () {
  kendo.bind($("#my-form"), MyApp.ViewModel);
});
Petur Subev
Telerik team
 answered on 30 Jan 2013
1 answer
325 views
I'm using the kendoGrid, but I don't know the type of transport which is raising the error. Can I get it in any way?
Here is the sample code:
dataSource = {
transport: {
                    read: "http://www.mysite.com/get",
                    update: {
                          url: "http://www.mysite.com/update",
                          data: {}
                    },
                    destroy: {
                          url: "http://www.mysite.com/delete",
                          data: {}
                    },
                    create: {
                          url: "http://www.mysite.com/create",
                          data: {}
                    }
                },
                error: function (e) {
                      //todo: How can I get which type of request is making? get, update, destroy, or create? Different error types have different error message.
                }
};
Alexander Valchev
Telerik team
 answered on 30 Jan 2013
1 answer
921 views
running a template on a data object of pictures returned from facebook

Object {data: Array[8]}
data: Array[8]
__proto__: Object

sometimes the object returns an additional array of 'paging', sometimes it doesn't

How can I get something like this?

<script id="albums-photos-template" type="text/x-kendo-template">
# if (paging) { #
# if (paging.previous) { #
<a href='#= paging.previous #' class='albums-prev'>prev</a>
# } #
# } #
etc

I'm getting something like this

Uncaught ReferenceError: paging is not defined


Petyo
Telerik team
 answered on 30 Jan 2013
3 answers
118 views
Hi,
I need help with a grid with 3 detail rows each editable and with own datasources - like this http://jsbin.com/epocid/1/
When I hook this up to my datasources, while the read fires and data is returned for all datasources, only the Master and first detailRow gets populated. Thanks in advance for help.
Pete

Vladimir Iliev
Telerik team
 answered on 30 Jan 2013
2 answers
389 views
 <script id="treeview-template" type="text/kendo-ui-template">
            <button  class="editrow"><i class="icon-pencil"></i>Edit</button>
            <button  class="removerow k-button"><i class="icon-trash"></i>Delete</button>
         
             <span class="k-label" style="margin-left:50px">#: item.AttrID #</span>  <span class="k-label" style="margin-left:150px"> #: item.AttrDesc #</span>
            <input type="hidden" name="itemid" value="#: item.UID # ">
            <input type="hidden" name="itemCustomerUID" value="#: item.CustomerUID # ">
             <input type="hidden" name="itemAttrTable" value="#: item.AttrTable # ">
            <input type="hidden" name="itemAttrID" value="#: item.AttrID # ">
             <input type="hidden" name="itemAttrDesc" value="#: item.AttrDesc # ">                      
</script>     

both 
  $('.removerow').on('click', function (e) {                  
            alert('removerow edit');           
        });

and
  $('.removerow').on('click', function (e) { 
  e.preventDefault();
            e.stopPropagation();                
            alert('removerow edit');           
        });
can not work.


i even add 
 $('#treeview').kendoTreeView({
            dataSource: hierarchyAttrs,
             select: onSelect,
            template: kendo.template($("#treeview-template").html())
        });

        function onSelect(e) {
            alert('sel');
           e.preventDefault();
          e.stopPropagation();
         }
it can show 'sel'
but  alert('removerow edit');  still can not work.

same thing for the .editrow


pls help , urgent.
thanks
andy



Alex Gyoshev
Telerik team
 answered on 30 Jan 2013
3 answers
303 views
I have a scenario where I want to save kendo grid batch edit and other fields in the form in one submit button press. 
Daniel
Telerik team
 answered on 30 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?