Telerik Forums
Kendo UI for jQuery Forum
8 answers
298 views
I found a very strange problem, and it took my another 4 hours, can't solve it:

BackGround: the latest kendoUI. the scheduler could show it's self, with no js errors. The client-side code is below:

jQuery("#workcalendar").kendoScheduler({
        date: new Date(),
    startTime: new Date("2013/6/13 07:00 AM"),
    height: 600,
    views: [
        "day",
        { type: "workWeek", selected: true },
        "week",
        "month",
        "agenda"
    ],
    //timezone: "Etc/UTC",
        dataSource:
        {
              transport:
              {
                read:
                {
                    type: "POST",
                    url: "KPIGetData/DimData.aspx?SearchInput=schedulerevent",
                    dataType: "json"
                     
                },
                update:
                {
                    type: "POST",
                    url: "KPIGetData/DimSavingData.aspx?SearchInput=schedulereventedit",
                    dataType: "json"
                },
                create:
                {
                    type: "POST",
                    url: "KPIGetData/DimData.aspx?SearchInput=schedulereventadd",
                    dataType: "json"
                },
                destroy:
                {
                    type: "POST",
                    url: "KPIGetData/DimData.aspx?SearchInput=schedulereventdel",
                    dataType: "json"
                }
                 ,
                     parameterMap: function(options, operation)
                     {
                      if (operation === "read")
                      {
                            var result ="&SearchValue="+CurrentUserID+"&StartTime="+SearchTimeStart+"&EndTime"+SearchTimeEnd;
                            alert("hit:"+result);
                            return kendo.stringify(result);
                        }
                        else if (operation !== "read" && options.models)
                        {
                            return {models: kendo.stringify(options.models)};
                        }
                     }
              }
              ,
              schema:
              {
                model:
                {
                  id: "taskId",
                  fields:
                  {
                    taskId: { from: "TaskID",type: "number"},
                    title: { from: "Title",defaultValue: "No title", validation: { required: true }},
                    start: { type: "date", from: "Start" },
                    end: { type: "date", from: "End" },
                    description: { from: "Description" },
                    recurrenceId: { from: "RecurrenceID" },
                    recurrenceRule: { from: "RecurrenceRule" },
                    recurrenceException: {from:"RecurrenceException"},
                    ownerId: {from: "OwnerID", defaultValue: 1},
                    isAllDay: {type: "boolean",from:"IsAllDay"}
                  }
                }
              },
               requestEnd: function(e)
               {
                var response = e.response;
                alert("here:"+response +"|"+JSON.stringify(response));
                 
                 
              },
               error: function(e) {
                alert(e.status);
               }
        }
       
    });

On the server side, it's asp.net c#. And I have  an A/B test.

Test A:  
string test1 = "[{\"TaskID123\":\"885\"}]";
  Response.Clear();
  Response.ContentType = "application/json";
  Response.Charset = "UTF-8";
  Response.Write(test1);
  Response.End();
In Test A, I just write a json string into an variable, then response back it to the browser.  In the requestEnd: I received it correctlly. Please NOTE that I know it's not a full set of the fields, my point is not talking about that, just see the Test B.

Test B:
  DataTable dt = null;
  DataRow[] drdtv = null;
  using (System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["HROK"].ConnectionString))
  {
                cn.Open();
               string sql = "select top 1 TableID from OAOrderTaskFactBill";
                SqlCommand cmd = new SqlCommand(sql, cn);
               SqlClient.SqlDataAdapter ada =new SqlClient.SqlDataAdapter();
                ada.SelectCommand = cmd;
               ada.Fill(dt);
}
 
  string test2 = "[{" + "\"" + "TaskID" + "\"" + ":" + "\"" + dt.Rows[0]["TableID"].ToString() + "\"" + "}]";
 
 Response.Clear();
 Response.ContentType = "application/json";
Response.Charset = "UTF-8";
Response.Write(test2);
Response.End();

Please NOTE that the C# has no errors, and the server could return the json VERY WELL.  I know it because I copy the "KPIGetData/DimData.aspx?SearchInput=schedulerevent/&SearchValue="+CurrentUserID+"&StartTime="+SearchTimeStart+"&EndTime"+SearchTimeEnd" in to the brower address-line and enter to see the return json. In TestA and TestB, both return [{"TaskID123":"885"}]

But in TestB, the Scheduler can't receive the json in the requestEnd: at all! 
alert("here:"+response +"|"+JSON.stringify(response));
it shows:  here:undefined|undefined

I test these for many times, the result is the same.
I found that the ONLY diffrent between A/B is, in TestA, the Json is in a constant, hard coded string like 885, even you hard code it into an variable, it's a constant in fact. But in TestB, the Json is created from a real variable, which get value from database.

So the conclusion is, (I know it's impossible, but don't know what's wrong), the Scheduler's Read could only get Json from a hard coded constant string, may be your demo site use the hard coded constant string Json to demo in your backend?  When the Json is not hard coded in the C#, Scheduler will get an undefined or just an empty.

By the way, I have tested this:
 return new JavaScriptSerializer().Serialize(Tasktings);
Taskting is a list<> which created to hold the values.
The result is same.

I swear I met this problem( a hard coded json in c#, is diffrent with one created from variable) many years ago. But I did not write down what happened and how to solve it.

Please help, the scheduler is very hard to use, document and online demo has litte full-example, only show one of the few main functions.
I have spend over 15 hours in the sheduler,  I am very sorry, but please help.

yours,
Ivan








Vladimir Iliev
Telerik team
 answered on 01 Dec 2014
3 answers
355 views
Hi there,

I would like to implement grid with virtualization and one column with checkboxes. Each checkbox should display it's 'checked/unchecked' states when scrolling among pages.

Thanks in advance,

Andrii Frankiv
Alexander Popov
Telerik team
 answered on 01 Dec 2014
3 answers
104 views
I want to do something like this:

function myRefresh(grd)
{
   if(somecondition)
   {
       grd.datasource.transport = {
            read: { someArguments }
            }
        }
      
        grd.dataSource.read();
   }
   else
   {
       grd.dataSource.transport = undefined;
       grd.dataSource.data(somedata);
   }
}


Based on a condition I want to change how grid reads data. myRefresh(grd) may run anytime during runtime.

But as datasource is changed from static data to transport I get "t.transport.read is not a function" error which is proabaly because datasource.transport was not initially defined.

Do I have to recreate the grid? Or is there a shorter way?
Kiril Nikolov
Telerik team
 answered on 01 Dec 2014
1 answer
143 views
Hey,
Is there rtl support in the gantt widget?
when i try k-rtl my tasks still behave like left to right..
Thanks :)
Dimitar Terziev
Telerik team
 answered on 01 Dec 2014
1 answer
191 views
Hello!
I am looking for a proper way to change the embedded RESIZE_TOOLTIP_TEMPLATE, because I need to localize it - see the example below:

 var RESIZE_TOOLTIP_TEMPLATE = kendo.template('<div style="z-index: 100002;" class="#=styles.tooltipWrapper#">' +
                                   '<div class="#=styles.tooltipContent#">' +
                                        '<div>RozpoczÄ™cie: #=kendo.toString(start, "d MMMM yyyy")#</div>' +
                                        '<div>ZakoÅ„czenie: #=kendo.toString(end, "d MMMM yyyy")#</div>' +
                                   '</div>' +
                              '</div>');

How can I achieve this effect?
Thanks in advance.

Bozhidar
Telerik team
 answered on 01 Dec 2014
3 answers
153 views
Setting the checked property on a node in a treeview programatically does not cause the checkbox to update. In other words it remains in its initial state of clear or checked irrespective of how many times the checked property is toggled.

This can bee seen in the attached file or at http://dojo.telerik.com/exaP
Colin
Top achievements
Rank 1
 answered on 28 Nov 2014
7 answers
227 views
I want to strip all formatting from a paste of a word document in the editor. I use the sample http://dojo.telerik.com/obaPu , with paste-function overide:

paste: function(e) {
    e.value((e.html).text());
 }


If I look a the editor in this example, it has still the formatted text. Even if i replace 
e.value((e.html).text()); by
​
e.value("test");
still the pasted text has not been changed. What am i doing wrong?

Thanks
Alex Gyoshev
Telerik team
 answered on 28 Nov 2014
2 answers
168 views
Hello,

I have the following issue when trying to use a TreeList in my angular application.
I have the following element in my HTML file (for the tree list):

<kendo-treelist options="treelistOptions" k-rebind="treeListDataTrigger"></kendo-treelist>

And the treelistOptions object looks like this:

$scope.treelistOptions = {            
dataSource: new kendo.data.TreeListDataSource({
data: treeListData,
         
schema: {
                  model: {
                  id: "id",​                
expanded: true
                  }
                }
              }),
             columns: [...]
            };
 
Actually when I'm importing the file kendo.all.js, the above code works fine. But when I'm trying to import only the necessary files (kendo.treelist.js, and kendo.angular.js) I can not instantiate the TreeListDataSource. It says it is undefined.

Am I missing anything ? or how should I proceed to get the treelist working correctly by using only the necessary files and not kendo.all.js?

Thierry
Top achievements
Rank 1
 answered on 28 Nov 2014
5 answers
430 views
Considering the following HTML: 
<input value="" class="date-depth-year"><br />
<input value="" class="date-depth-year"><br />
<input value="" class="date-depth-year"><br />
<input value="" class="date-depth-year"><br />
<input value="" class="date-depth-year"><br />

Why does the following NOT work (to be specific, it sets the min date for the first date picker only, not all of them): 

<script>
    $(".date-depth-year").kendoDatePicker({
      start: "year",
      depth: "year"});
     
    console.log ($("[data-role=datepicker]").length);
    $("[data-role=datepicker]").data("kendoDatePicker").setOptions({
      min: "2014/12/01"
    });
     
  </script>

I know I can do this using a jQuery each loop, which definitely works, but I was interested to know why the above JS wouldn't work to set the min values for all the DatePickers on that page? 

See the following dojo:
http://dojo.telerik.com/@Jacques.vanderhoven/ebawO

Thanks,
Jacques
Kiril Nikolov
Telerik team
 answered on 28 Nov 2014
1 answer
130 views
Hi,

Our requirement is to use Service Side Endless Scroll functionality using mobile list view. This will work fine using DataSource and setting the Url parameter.

However, we cannot use this approach in our application. This is because we can't directly call any Urls from our mobile app. We are using WorkLight adapters to make calls to the server. These calls will be using pure JavaScript methods. We can get "Deferred" objects from worklight adapters. Is there any way that we can use these deferred objects to populate the datasource?

Thanks in advance,
Pavan.
Kiril Nikolov
Telerik team
 answered on 28 Nov 2014
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
Drag and Drop
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?