Telerik Forums
Kendo UI for jQuery Forum
5 answers
319 views
Calling a refresh(); does not work.


My code:

<!-- ============================================================================================ newsFeed -->
<div data-role="view" data-show="getNewsFeedData" data-title="myFitness" id="view-newsFeed">
<header data-role="header">
<div data-role="navbar">
<span data-role="view-title"></span>
<a data-align="left" data-role="backbutton" class="nav-button" >Back</a>
<a data-align="right" data-role="button" class="nav-button" href="#view-addEvent">Add Event</a>
</div>

<div id="no-feed-content" style="display:none;">
<div class="km-navbar pullRefresh">No More Events | Pull to Refresh</div>
</div>

</header>
<div class="loginButtonWrapper">

<div id="showAllEventsButtonWrapper">
You are viewng Your Friends Events<br>
<a id="showAllEventsButton" class="k-button" data-click="showEventsSwitch" data-role="button" data-show="1">Show All Users</a>
</div>
<div id="showFriendEventsButtonWrapper" >
You are viewing All Users Events<br>
<a id="showFriendEventsButton" class="k-button" data-click="showEventsSwitch" data-role="button" data-show="0">Show Only Friends</a>
</div>
</div>

<ul id="newsFeed"></ul>

</div>

<!-- =================================================================================== newsFeed Template -->
<script id="newsFeed-template" type="text/x-kendo-template">

<div class="feed">

# if (type == '1') {# 
<img class="feed-user-image" src="http://gohhllc.com/fitfan/app/images/#= profile_image_url #
" alt="#= from_user #" />${feed_id}

<div class="feed-content">${from_user} # if (attendees != null && attendees.length >= 1) {
for (var i = 0; i < attendees.length; i++) { #
and ${attendees[i].name} # }
# are attending a # }
else {
if (from_user == 'You') {
# are attending a # }
else { #
is attending a #}
}
#  #= title #
class at #= loc #
on #= event_stamp # </div>
<div>
<img class="mini-icon news-feed-mini-icon" src="styles/icons/ClassICON.png"  />
</div>
#}#

# if (type == '2') {#
<img class="feed-user-image" src="http://gohhllc.com/fitfan/app/images/#= profile_image_url #
" alt="#= from_user #" />${feed_id}

<div class="feed-content">${from_user} # if (attendees != null && attendees.length >= 1) {
for (var i = 0; i < attendees.length; i++) { #
and ${attendees[i].name} # }
# are doing a # }
else {
if (from_user == 'You') {
# are doing a # }
else {
# is doing a #}
}
#  #= title #
routine at #= loc #
on #= event_stamp # </div>
<div>
<img class="mini-icon news-feed-mini-icon" src="styles/icons/RoutineICON.png"  />
</div>
#}#    

#if (user_id == localStorage.getItem("userID")) { #
<div id="newsID_${feed_id}" class="feed-join-wrapper">
<a data-role="button" class="feed_cancel_join_button"  data-rel="actionsheet" data-actionsheet-context="${event_id}|${feed_id}" href="\\#cancelActionSheet">CANCEL</a>
</div> #}#

#if (share == '1' && user_id != localStorage.getItem("userID")) { #
<div id="newsID_${feed_id}" class="feed-join-wrapper">
<a data-role="button" class="feed_cancel_join_button"  data-rel="actionsheet" data-actionsheet-context="${event_id}|${feed_id}" href="\\#joinActionSheet">JOIN</a>
</div> #}#


<ul data-role="actionsheet" id="joinActionSheet">
<li>
<a data-action="joinConfirm">Confirm Join</a>
</li>
</ul>

<ul data-role="actionsheet" id="cancelActionSheet">
<li>
<a data-action="cancelConfirm">Confirm Cancel</a>
</li>
</ul>

</div>
</script>

<!-- ===================================================================================== newsFeed script -->
<script>

function joinConfirm(e) {
//console.log(e.target);
//send join request
//post join
$.ajax({
url: endpoint + "app/api/join_event.php",
data: { userID: userID, event_id: e.context},
dataType: "jsonp",
type: "GET",
success: function (data) {
newsID = '#newsID_' + e.target;
console.log("<= joinEvent - " + newsID);

$(newsID).html("<div class=\"eventStatusUpdate\">You are Attending this event</div>");
//app.navigate("#view-myEvents");
}
});
}

function cancelConfirm(e) {
//console.log(e.context);
//send cancel request
//split the context var
values = e.context.split('|');
eventID = values[0];
newsID = values[1];

//post cancel
$.ajax({
url: endpoint + "app/api/cancel_event.php",
data: { userID: userID, event_id: eventID},
dataType: "jsonp",
type: "GET",
success: function (data) {
newsID = '#newsID_' + newsID;

$(newsID).html("<div class=\"eventStatusUpdate\">This Event is Now Cancelled</div>");
//app.navigate("#view-myEvents");
}
});
}

//define newsfeed data
var newsFeedDataSource = null;
                            

function getNewsFeedData() {
console.log("<= getNewsFeed =>");     
//check if we show news for all users (even non-friends)

if (localStorage.getItem("showAllEvents") == "1") {
showAllEvents = 1;
console.log("<= showing all events =>");
//show/hide buttons
$("#showFriendEventsButtonWrapper").show();
$("#showAllEventsButtonWrapper").hide();
}
else {
showAllEvents = 0;
console.log("<= showing only friend events =>");
//show/hide buttons
$("#showFriendEventsButtonWrapper").hide();
$("#showAllEventsButtonWrapper").show();
}

newsFeedDataSource = new kendo.data.DataSource({
serverPaging: true,
pageSize: 2,
cache: false,

change: function (e) {
//if no more results turn off endlessscroll
if (e.items.length < e.sender._pageSize) {
//show pull to refresh header
$("#no-feed-content").show();

var list = $("#newsFeed").data("kendoMobileListView");
if (list && list._scrollerInstance) {
list._scrollerInstance.unbind('scroll');
}
}
else {
//hide pull to reresh header
$("#no-feed-content").hide();
}
},
transport: {
read: {
url: endpoint + "app/api/show_feed.php", // the remote service url
data: { userID: userID, showAllEvents: showAllEvents},
dataType: "jsonp" // JSONP (JSON with padding) is required for cross-domain AJAX
},
parameterMap: function(options) {
return {
userID: options.userID,
page: options.page,
rpp: options.pageSize,
showAllEvents: options.showAllEvents,
since_id: options.since_id, //additional parameters sent to the remote service
max_id: options.max_id //additional parameters sent to the remove service
};
}
},
schema: { // describe the result format
data: "results", // the data which the data source will be bound to is in the "results" field,
}

});
                            
$("#newsFeed").kendoMobileListView({
dataSource: newsFeedDataSource,
template: $("#newsFeed-template").text(),
pullToRefresh: true,
//addition parameters which will be passed to the DataSource's read method
pullParameters: function(item) { //pass first data item of the ListView
return {
max_id: item.max_id,
page: 1
};
},
endlessScroll: true,
//scrollThreshold: 60,
//addition parameters which will be passed to the DataSource's next method
endlessScrollParameters: function(firstNewsID, lastNewsID) {
if (lastNewsID) {
return {
since_id: lastNewsID.since_id
};
}
}
});
}

function showEventsSwitch(e) {
//get button vars
var data = e.button.data();

if (data.show == '1') {
console.log("<= all users button clicked");
localStorage.setItem("showAllEvents", 1);

//show/hide buttons
$("#showFriendEventsButtonWrapper").show();
$("#showAllEventsButtonWrapper").hide();
}

if (data.show == '0') {
console.log("<= only friend button clicked");
localStorage.setItem("showAllEvents", 0);

//show/hide buttons
$("#showFriendEventsButtonWrapper").hide();
$("#showAllEventsButtonWrapper").show();
}

//now refresh news feed
console.log("<= refreshing news feed =>");
newsFeedDataSource.read();
                            
console.log(newsFeedDataSource);
$("#newsFeed").data("kendoMobileListView").refresh();
//app.navigate("#view-Home"); 
Steve
Telerik team
 answered on 26 Apr 2013
3 answers
579 views
Hi guys,

Im trying to disable or enable a button command into the grid based on some condition from data, how can I do that?

Thanks In Advance.

KMI
Vladimir Iliev
Telerik team
 answered on 26 Apr 2013
1 answer
73 views
Hi,

I am currently making my first experiences with Kendo UI and a ASP.NET MVC 4 project. At the moment I have a list stored in a standard .Net System.Collections.Sortedlist object and would like to fill a Kendo UI combobox with the values from that list. I also tried to first build a Kendo datasource object, that contains the elements from that Sortedlist, but I could not get that to work.

How can I:
  • fill a Kendo UI combobox with elements from a .Net System.Collections.Sortedlist object?
or
  • fill a Kendo UI datasource (which I will later use to create the combobox) with elements from a .Net System.Collections.Sortedlist object?

Regards
Sven
Vladimir Iliev
Telerik team
 answered on 26 Apr 2013
2 answers
206 views
This jsfiddle: http://jsfiddle.net/nDmjt/8/

Is throwing this:

ReferenceError: min is not defined

Any ideas on what I'm doing wrong?

  Nick
Jeff
Top achievements
Rank 1
 answered on 26 Apr 2013
1 answer
200 views
Hi there!

I´m using some MVC-actions to retrieve my data. The dates within my objects are serialized like that:
MyDate:/Date(1325372400000)/

Setting the value to a DatePicker works fine if the value/number is > 0. (a date after 1.1.1970...).
If the number is < 0 it does not work.

But
new Date(-50000)
works also fine (and results in xx.xx.1969).

That´s how I set the value using javascript:
_jquery.data('kendoDatePicker').value(_value);

I found a different thread having problems with the value. It was solved by changing the min value. But that has no effect.

Is it officially supported using the .net-formatted-date-json as value?
Or is there a bug?
What could be the problem?

My environment:
- kendoUI-version: 2013.1.319.340
- Windows7
- IE10
- jQuery 1.9.1

Best Regards!
Elko
Top achievements
Rank 1
 answered on 26 Apr 2013
1 answer
156 views
I have a fancybox (lightbox style plugin) which calls a div containing a treeview mvc wrapper.
This error is thrown when the lightbox is called (referring to line 24 from the kendo minified scripts file)

Line: 24
Error: Unable to get value of the property 'uid': object is null or undefined


The treeview;
@(Html.Kendo().TreeView()
    .Name("treeview")
    .DataTextField("TableName")
    .DataSource(dataSource => dataSource
        .Read(read => read
            .Action("ExportAll", "Export")
        )
    )

The treeview loads fine on the page into a div (originally hidden by parent div - before fancybox is loaded) and I can view it if i remove the "display:none" on the parent div.

It is at the point that the fancybox is loaded that the error is thrown.

This lead me to think that there was an issue with the fancybox, but if I replace the treeview with any other kendo wrapper - chart, grid etc then the lightbox works fine.

Is there an issue with fancybox and treeview combined?

Thanks


Dimo
Telerik team
 answered on 26 Apr 2013
1 answer
332 views
As the subject says, is it possible to implement a button on the Grid Group Headers? I want to build a grid that lets the user group how they would like, find a specific group in the grid and press a button to initiate an action on the specific group. Is this possible and if so, how can this be achieved?

Cheers,

Jamie.
Dimo
Telerik team
 answered on 26 Apr 2013
7 answers
194 views
Hello everybody,

referring to the thread: http://www.kendoui.com/forums/dataviz/general-discussions/memory-leaks.aspx#2490157 we perfomed updates of kendoUI and jQuery. Unfortunately problem still exists after updating. 

We spent a lot of time figuring out the cause. As you can see in the attached screenshot the Shapes and Ovals in the DataViz remain present in the DOM. Perhaps this isn´t new to you. Nevertheless we need a solution as soon as possible.

I attached a screenshot where you can see the memory leak. 

You can easly reproduce this behaviour using this test scenario:
http://www.kendoui.com/forums/dataviz/general-discussions/memory-leaks.aspx#z8TQWdQYx0-1SLF-SWApjA .

Feel free to contact me.

Regards,
Markus.




Petyo
Telerik team
 answered on 26 Apr 2013
10 answers
295 views
Using IE9, if you browse to http://demos.kendoui.com/web/editor/index.html and click on an option in the Editor toolbar that opens a dialog (e.g. “insert image” or “insert hyperlink”), the modal dialog that opens will scroll the browser window to the bottom of the page. I mentioned this in an email to Tim Tognacci in your sales team and he came back with "this is actually an issue with IE9, not Kendo UI" ...LOL!
Dimo
Telerik team
 answered on 26 Apr 2013
1 answer
98 views
Hi,

I'm using KendoUI Web v2013.1.319 and developing Grid (popup editing) fetching data from my web service inorder to fetch my data. Now I want to two add new button on end of each row when user clicks I need popup an window to perform CURD operation. 

First button need to pass data from row selected along with additional details and second button is totally new page based on updating I need to navigate to sub-subsequent page which similar to task flow.

Please anyone help me out.

Regards
Amar
Daniel
Telerik team
 answered on 26 Apr 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
Application
Map
Drag and Drop
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?