Telerik Forums
Kendo UI for jQuery Forum
12 answers
470 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
700 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
364 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
971 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
143 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
451 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
359 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
1 answer
319 views
Hi i am using kendo grid in my page defined in javascript. Below is my grid code in javascript

 function LoadAllPanelUsers() {
                 
                 dataSource = new kendo.data.DataSource({
                     transport: {
                         read: {
                             url: "/Home/LoadAllUsers",
                             type: "POST",
                             dataType: "json"
                         },
                         update: {
                             url: "/Home/UpdateUser",
                             dataType: "json",
                             type: "POST"

                         },
                         destroy: {
                             url: "/Home/DeleteUser",
                             dataType: "json",
                             type: "POST"
                             
                         },
                         create: {
                             url: "/Account/InsertUser",
                             dataType: "json",
                             type: "POST"
                                        
                         },
                         parameterMap: function (options, operation) {
                             if (operation !== "read" && options.models[0]) {
                                 return options.models[0];
                             }
                         }
                     },
                     type: "json",
                     batch: true,
                     schema: {
                         model: {
                             id: "UserID",
                             fields: {
                                 UserID: { editable: false, nullable: true, type: "number" },
                                 UserNumber: { type: "number", validation: { required: true, max: 96} },
                                 UserDescription: { type: "string", validation: { maxLength: 31} },
                                 PartitionNumber: { editable: false, type: "number", defaultValue: "1", validation: { required: true} },
                                 AuthorityLevel: { type: "number", validation: { required: true }, defaultValue: 0 },
                                 UserCode: { type: "number", validation: { required: true, maxLength: 4, minLength: 4} },
                                 IsDeleted: { type: "bool" },
                                 IsEnabled: { type: "bool" }
                             }
                         },
                         data: "data",
                         total: "total"
                     }
                 });

                 var PanelDevices = [];
                 $("#rdgrd_AIB_UserResults").empty();
                 $("#rdgrd_AIB_UserResults").kendoGrid({
                     dataSource: dataSource,
                     height: 410,
                     selectable: "row",
                     
                     toolbar: ["create", "save", "cancel"],
                     columns: [
                            {
                                field: "UserNumber",
                                title: "User Number",
                                width: 150
                            },
                            {
                                field: "UserDescription",
                                title: "User Name",
                                width: 150
                            },
                            {
                                field: "PartitionNumber",
                                title: "Partition Number",
                                width: 150
                            },
                            {
                                field: "UserCode",
                                title: "User Code",
                                width: 150
                            },
                            {
                                field: "AuthorityLevel",
                               
                                title: "Authority Level",
                                width: 150
                            }
                    ],
                     editable: true,
                     navigatable: true
                 });
             }

when i insert the row , enter necessary values and click on save changes the controller action is called and the user is created in DB successfully. i return the same object after updating the new user id to the grid. below is my response body recieved from controller action.

  1. Request URL:
    http://localhost:60410/Account/InsertPanelUser
  2. Request Method:
    POST
  3. Status Code:
    200 OK
  4. Request Headersview source
    1. Accept:
      application/json, text/javascript, */*; q=0.01
    2. Accept-Charset:
      ISO-8859-1,utf-8;q=0.7,*;q=0.3
    3. Accept-Encoding:
      gzip,deflate,sdch
    4. Accept-Language:
      en-US,en;q=0.8
    5. Cache-Control:
      no-cache
    6. Connection:
      keep-alive
    7. Content-Length:
      110
    8. Content-Type:
      application/x-www-form-urlencoded
    9. Cookie:
      ASP.NET_SessionId=fjvgg5ehwlifhoukfi3zeupq
    10. Host:
      localhost:60410
    11. Origin:
      http://localhost:60410
    12. Pragma:
      no-cache
    13. Referer:
      http://localhost:60410/Home/Home
    14. User-Agent:
      Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17
    15. X-Requested-With:
      XMLHttpRequest
  5. Form Dataview sourceview URL encoded
    1. UserID:
      null
    2. UserNumber:
      43
    3. UserDescription:
      test234
    4. PartitionNumber:
      1
    5. AuthorityLevel:
      3
    6. UserCode:
      5428
    7. AccountID:
      0
  6. Response Headersview source
    1. Cache-Control:
      private
    2. Connection:
      Close
    3. Content-Length:
      254
    4. Content-Type:
      application/json; charset=utf-8
    5. Date:
      Mon, 28 Jan 2013 09:24:37 GMT
    6. Server:
      ASP.NET Development Server/10.0.0.0
    7. X-AspNet-Version:
      4.0.30319
    8. X-AspNetMvc-Version:
      4.0
Response data
{"ExtensionData":null,"AuthorityLevel":3,"Changed":false,"ChangedBy":null,"Defaulted":false,"IsDeleted":false, "IsEnabled":false,"MacPanelID":0,"PartitionNumber":1,"SortIndex":null,"UserCode":"5428","UserDescription":"test234", "UserID":66,"UserNumber":43} in the response data you can see that the user id is 66. this id is not getting updated in the grid data. following is my grid data after save changes

$("#rdgrd_AIB_UserResults").data('kendoGrid')
h.extend.init
  1. _currentjQuery.fn.jQuery.init[1]
  2. _dataArray[8]
    1. 0f
      1. AccountID0
      2. AuthorityLevel3
      3. PartitionNumber"1"
      4. UserCode5428
      5. UserDescription"test234"
      6. UserIDnull
      7. UserNumber43
      8. _eventsObject
      9. dirtyfalse
      10. idnull
      11. parentfunction (){return c}
      12. uid"a9eb1dab-0ce5-43a4-a1ef-2596db7b5c07"
      13. __proto__b
    2. 1f
    3. 2f
here in the above object you can see that id and userid is null
Petur Subev
Telerik team
 answered on 30 Jan 2013
2 answers
613 views
Hello all,

   I'm trying to get a fixed size panelbar (see: http://www.kendoui.com/forums/ui/panelbar/static-sized-panelbar.aspx ) working in a more "mobile" feel. The fixed size part is working just great. But - is there a way to have the fixed size "long" content in the panelBar scroll with overshoot and bounce back like on the kendo mobile listView and other mobile widgets? Can I somehow put the content items in a scroller control? I'm not too sure how to make that work.

Cheers,
Stephen
S
Top achievements
Rank 1
 answered on 30 Jan 2013
9 answers
282 views
Hello,

when i bind a listview to a grouped datasource, the click event fires twice.
how can I prevent it, if this is intended?

Kind regards
Axel
Iliana Dyankova
Telerik team
 answered on 29 Jan 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?