Telerik Forums
Kendo UI for jQuery Forum
2 answers
119 views

Thank you in advance for any feedback:

1) Am I defining correctly the parameters to be passed on my vm.audit.load function on the grid data source?

$(document).ready(function () {
    var vm = kendo.observable(fhfa.vm.default({
        container: $("#app-main"),
        appVersion: audit.constants.appVersion
    }));

    //***grid data***
    var o = audit.auditCollection({});
    vm.set("audit", o);

   // kendo.bind($("#app-main"), vm);

 

     $("#grid").kendoGrid({
        //data: vm.audit.load,

        dataSource: {
            p : function(){

                //*** Search criteria values ***
                var auditTypeCB = $("#auditType").data("kendoComboBox");
                auditTypeID: checkIfZeroOrBlank(auditTypeCB.select());

                startDate: checkIfZeroOrBlank($("#sDate").val());
                endDate: checkIfZeroOrBlank($("#eDate").val());

                var applicationCB = $("#appDropDownList").data("kendoComboBox");
                applicationID: checkIfZeroOrBlank(applicationCB.select());

                auditUser: checkIfZeroOrBlank($("#user").val());
                ipAddress: checkIfZeroOrBlank($("#ipAddress").val());
                auditDescription: checkIfZeroOrBlank($("#description").val());

                pageOffset: null;
                pageSize: 0;
                orderBy: null;
                orderByDirection: null
            },
            schema: {
                data: "audit.items"
            },
            transport: {
                read: function (options) {
                    vm.audit.load(p.applicationID, p.auditTypeID, p.auditUser, p.ipAddress, p.startDate, p.endDate, p.auditDescription, p.pageOffset, p.pageSize, p.orderBy, p.orderByDirection, p.pageMax).then(function () {
                        options.success(data);
                    });
                }
            }
        },
        columns: [{
            field: "applicationID",
            hidden: true
        },
        {
            field: "auditTypeID",
            title: "Type"
        },
        {
            field: "auditDate",
            title: "Date",
        },
        {
            field: "applicationName",
            title: "Application",
        },
        {
            field: "auditUser",
            title: "User"
        },
        {
            field: "iPAddress",
            title: "IP Address"
        },
        {
            field: "auditDescription",
            title: "Description"
        }],
        scrollable: true,
        groupable: true,
        reorderable: true,
        sortable: true,
        selectable: true
    });

 

 audit.auditCollection = function (init) {
    var o = fhfa.object.baseCollection(init);
    o._name = "auditCollection"
    o._createObject = function () {
        return audit.audit(init);
    };
    o.onloading = function (args) {
        vm = this;
        kendo.ui.progress(vm._view.element, args.isLoading);
    };
    o.load = function (applicationID, auditTypeID, auditUser, ipAddress, startDate, endDate, auditDescription, pageOffset, pageSize, orderBy, orderByDirection, pageMax) {
        var that = this;

        var vPageSize = 100;
        var vCount = 0;
        var def = $.Deferred();
        that._isLoading = true;

        if (pageSize === 0) {
            pageSize = vPageSize;
        }

        audit.da.auditItems_get(applicationID, auditTypeID, auditUser, ipAddress, startDate, endDate, auditDescription, pageOffset, pageSize, orderBy, orderByDirection, vPageSize, pageMax).done(function(eResult) {
            var items = eResult.d.auditItems;
            vCount = eReResult.d.auditItems.lenght;
            that.set("total", vCount);
            that.addArray(items);

            def.resolve(that);
        }).fail(function (error) {
            if (init.onerror) init.onerror({ source: that, sourceType: that._name, error: error });
            def.resolve(that);
        }).always(function () {
            that._isloading = false;
        });     

        return def.promise();
    };

Rocio
Top achievements
Rank 1
 answered on 09 Aug 2016
1 answer
422 views
Hello! 

 

When I use this code to disable 2nd and 3rd tab in each detailed row I see that only first expanded row has those tabs disabled - and all other rows that I expand are enabled - what am I doing wrong? Thanks for help!

var tabStrip = $("#mytabstrip").kendoTabStrip().data("kendoTabStrip");
            tabStrip.disable(tabStrip.tabGroup.children().eq(1));
            tabStrip.disable(tabStrip.tabGroup.children().eq(2));

 
<script type="text/x-kendo-template" id="template">
         <div class="tabstrip" id="mytabstrip">
             <button id="gridButton">gridButton</button>
             <ul>
                 <li class="k-state-active" id="AccountsTab">
                     Счета                       
                 </li>
                 <li id="AccountInfoTab">
                     Полная информация по счету:
                 </li>
                 <li id="BillEventsTab">
                     Просмотр событий по счету:
                 </li>
             </ul>
             <div>
                 <div id="account" class="Account"></div>
             </div>
              
         </div>
 
     </script>
Dimiter Topalov
Telerik team
 answered on 09 Aug 2016
1 answer
1.2K+ views

I have a page with kendoui slider, where i am checking if slider value is valid inside slider change event.
If value isn`t valid, i want to roll back slider value to previous value,  
But every time i set slider value (roll back to previous value) inside change event it doesn't work. 
For instance, mySlider initial value is 2.
The user is trying set the value to 10 but my validation function returns false (illegal value) and set my Slider back to it's initial value (2).
For some reason, right after that, the value of my Slider has been set up to 10 (the user choise) again(!!)
So practically my validation function has no meaning!!
It happens inside kendo.all.js in the function :

trigger: function (eventName, e) {
                var that = this, events = that._events[eventName], idx, length;
                if (events) {
                    e = e || {};
                    e.sender = that;
                    e._defaultPrevented = false;
                    e.preventDefault = preventDefault;
                    e.isDefaultPrevented = isDefaultPrevented;
                    events = events.slice();
                    for (idx = 0, length = events.length; idx < length; idx++) {
                    events[idx].call(that, e); ////////////////////////////////////////////////Here it change back to the user choise    
                    }
                    return e._defaultPrevented === true;
                }
                return false;
  },

My Code:

var slider =$("#slider").kendoSlider({
orientation: "vertical",
smallStep:1000,
largeStep:5000,
min:0,
max:100000,
value:50000,
change:Calc
});

function Calc(e){
    if (!(IsValid(e.value)))
   {
      $("#slider").data("kendoSlider").value(prevVal);
   }
}   ////////////////////////////////////////////////Here it calls to:trigger: function (eventName, e) which written above

Is there some any way to do it?

Tanks.

 


Misho
Telerik team
 answered on 09 Aug 2016
1 answer
409 views

Hello,

I'm attempting to create a masked datepicker using AngularJS.

I tried something like this, but it's not working :

 

<input kendo-date-picker
k-mask="00/00/0000"
k-options="{format: 'dd/MM/yyyy'}"
ng-model="vm.Filters.ToDate" />

Do you have a dojo of the solution ?

 

Thank you.

SLM
Top achievements
Rank 1
 answered on 09 Aug 2016
2 answers
229 views

Hi,

I'm attached to task edit and save events. When I open the task edit popup and change one field, I need to update the task end date. I tried editing e.task.end, e.values.end fields. The problem is, that when I click save and the save event is triggered, the values in e.values are filled with old values so the task is saved with old values.

Is there any way to update those values in the "edit" event, so when the "save" event is triggered, my task values are updated?

Thanks a lot,

Paweł

Paweł
Top achievements
Rank 1
 answered on 09 Aug 2016
2 answers
215 views

Hi,

 

I have a function which opens kendowindow. I am writing a qunit test case to test that particular function whether the particular function is working or not. Please help me with below snippet, where am i going wrong.

Function: addNew: function (e) {

            $("[data-Address]").data("kendoWindow").open();
        }

Test case:

QUnit.test("address", function (assert) {
        var wnd = $("[data-Address]").data("kendoWindow");
       var test= wnd.element.is(":hidden"); 
        cart.addNew();
        assert.equal($("test", false, "address");
    });

 

plz help me where am I gng wrong.

 

Thanks in advance.

Mohnish
Top achievements
Rank 1
 answered on 09 Aug 2016
3 answers
655 views

I'm using kendo Telerik.UI.for.AspNet.Mvc5 version 2016.2.607 in .net 452

i have my culture type in web.config set as:

<globalization uiCulture="de" culture="de-DE" />

if i use the following code to localize my website, it works fine (see 'first.png')

<script src="@Url.Content("~/Scripts/kendo/2016.2.607/cultures/kendo.culture." + System.Globalization.CultureInfo.CurrentCulture.Name + ".min.js")"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                kendo.culture("@System.Globalization.CultureInfo.CurrentCulture.Name");
            });
        </script>

if i remove that code and use @Html.Kendo().Culture() instead, i en-US date values (see 'second.png')

if i do a view source, the @Html.Kendo().Culture() seems to be working fine, see below.

<script>kendo.cultures["de-DE"]={name:"de-DE",numberFormat:{pattern:["-n"],decimals:2,",":".",".":",",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":".",".":",",groupSize:[3],symbol:"%"},currency:{pattern:["-n $","n $"],decimals:2,",":".",".":",",groupSize:[3],symbol:"€"}},calendars:{standard:{days:{names:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],namesAbbr:["So","Mo","Di","Mi","Do","Fr","Sa"],namesShort:["So","Mo","Di","Mi","Do","Fr","Sa"]},months:{names:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],namesAbbr:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"]},AM:[""],PM:[""],patterns:{d:"dd.MM.yyyy",D:"dddd, d. MMMM yyyy",F:"dddd, d. MMMM yyyy HH:mm:ss",g:"dd.MM.yyyy HH:mm",G:"dd.MM.yyyy HH:mm:ss",m:"d. MMMM",M:"d. MMMM",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"HH:mm",T:"HH:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM yyyy",Y:"MMMM yyyy"},"/":".",":":":",firstDay:1}}};</script>

what am i missing?

Daniel
Telerik team
 answered on 09 Aug 2016
2 answers
99 views

Hi,

I'm trying to create a stacked chart and i'm having trouble with the results - the stacked data is not a sum of all data points but rather an artificial number. I've made a dojo sample here http://dojo.telerik.com/EFIhUQ - the second column shoudl be 4 and it shows up as 120000... any idea why?

Daniel
Telerik team
 answered on 09 Aug 2016
1 answer
580 views

Hello developer,

Thanks for the support that you have provided in the course of time for the issues that I have faced during development.

I would like to put forward two issues that I'm facing with kendo scheduler(AngularJS)..

1)Is there any way that I could enable the pop up generated by double clicking on a date to be opened by a single click ?

2)Is there any way that I could define custom close event from my controller (I'm using AngularJS Kendo scheduler).

I tried by giving 

$scope.scheduleroptionds.window.close=true;

which works for the very first time but I have to reload the page every time to make it work..

Awaiting your kind reply..

Thanks again..

Vladimir Iliev
Telerik team
 answered on 09 Aug 2016
9 answers
290 views
Export to pdf showing "null"s on the 1st page and blank space on the subsequent pages.
My data has numeric values or 'null's. However while export all pages to PDF, the 'null's on the first page are converted to "null" and displaying as such, and on the subsequent pages they are appearing as blank spaces (which is the desired output).
Kiril Nikolov
Telerik team
 answered on 09 Aug 2016
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
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
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
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?