I am using multi month Datepicker
i am unable set a date range explicitly.
for eg i have to show sep 1st 2012 to 30 aug 2012 as selected on some button click.
documentation has this method but it only select the start date
$('selector').DatePickerSetDate(date, shiftTo);
Thanks in advance.
Found answer after going through plug-in code
$("selector").DatePickerSetDate([new Date(2012,8,1), new Date(2012,9,30)],1)
Try this
$('input').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd',
yearRange: '1920:'
});
hope it can help
Related
How is sorting and filtering implemented when using a custom header cell in the react-data-grid?
{
key: "myColumn1",
name: "My Column Name",
headerRenderer: this.renderHeader,
sortable: true,
filterable: true
},
{
key: "myColumn2",
name: "My Other Column Name",
sortable: true,
filterable: true
}
...
renderHeader(props){
return (<extra-stuff>
{props.column.name}
</extra-stuff>)
}
I have myColumn2 sorting fine but nothing happens with the custom header: myColumn1. What do I need to do in renderHeader(){} to get sorting (and filtering, but mainly sorting) working?
Instead of trying to call a function in headerRenderer, put a component instead:
{
key: "myColumn1",
name: "My Column Name",
headerRenderer: <renderHeader value={this.renderHeader()} />,
sortable: true,
filterable: true
},
Looks like a solution was checked-in for this almost a year ago. I do work on an intranet and don't have direct internet access for development so maybe i have an older version. Since I can't get the version in my environment I'll wait for someone to verify that the latest version works as expected before I accept my own answer (or I'll try to get the latest version with the change in there.)
One other thing I will have to do with the way the solution was implemented is stop propagation of the click event because in my custom header i have a ReactIcon that is clickable to change from status wording to a menu. So, if they click right on the icon in the header do the name/menu change and if they click anywhere else in the header then do the sort. I'll have to look up how to do that in React.
Update
I took the changes from the check-in in the link above and added them to my react-data-grid.js and it works great. I.e. I had to add the changes to the pure javascript version of the code that npm pulled into our node_modules.
I also did have to use e.stopPropagation() call in my headerRenderer like i thought i'd have to so that clicking the icon i have in the headerRenderer would not sort when click (but just do a different operation) but it was easy to add.
I do have one question about the change i made to my js which here is a piece of the change...
return React.createElement(
'div',
{className: className,
onClick: this.onClick,
style: {cursor: 'pointer'} },
React.createElement(
'span',
{ className: 'pull-right' },
this.getSortByText()
),
//change was here from just: this.props.column.name
this.props.column.headerRenderer? this.props.column.headerRenderer(this.props) : this.props.column.name
);
How would i have done this in JavaScript so that it would work whether my headerRenderer was ()=>{ return <span>...</span> } or <MyComponent /> ???
Since i always use functions for my headerRenderer i just did the change so that it worked the one way but would like to know how to make the change so it works both ways. Something like this? ...
this.props.column.headerRenderer?
(isFunction(this.props.column.headerRenderer)? this.props.column.headerRenderer(this.props) : React.createElement(this.props.column.headerRenderer, {...this.props}) )
:
this.props.column.name
????
The alchemy.js lib is create and provides good abstraction for graph layouts. I can't seem to get the application example that has a panel, allows searching and filtering. Zooming does not work either.
Here are the config values:
var config = {
dataSource: team,
cluster: true,
nodeCaption: "firstName",
rootNodeRadius: 30,
nodeCaptionsOnByDefault: true,
directedEdges:true,
showControlDash: true,
showStats: true,
nodeStats: true,
showFilters: true,
nodeFilters: true,
captionToggle: true,
edgesToggle: true,
nodesToggle: true,
toggleRootNotes: false,
search: true,
zoomControls: true
};
Here is the code that is not working:
https://jsfiddle.net/aneesha/mpa6sbsb/6/
So... I dug around and they seem to have left toggleControlDash out of Alchemy.prototype.interactions in the last couple of versions. I went back to their 0.3.1 version, copy/pasted the function into the new alchemy.js file, and now it works.
I'm pretty sure the examples are all built on different versions. I've found some other things that don't work too, I'm just going to go in and fix them on my own. If you're still looking for help on this, let me know :)
$reportViewer = $("#reportViewer1")
.telerik_ReportViewer({
serviceUrl: "/api/reports/",
templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate.html',
reportSource: { report: "MyClassLib.Group, MyClassLib" },
viewMode: telerikReportViewer.ViewMode.Interactive,
scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
scale: 1.0,
PersistSession: false
});
I wonder especially how serviceUrl works or where is /api/reports/
if you please tell other parameters i would be happy.
Thanks
Here is the link what all client-side properties explained
I cannot find a list of all possible options for SharePoint 2013 Client Chrome Control. I found examples like this:
var options = {
'appIconUrl': hostlogourl,
'appTitle': document.title,
'appHelpPageUrl': 'Help.html?' + document.URL.split('?')[1],
'settingsLinks': [
{
'linkUrl': 'Account.html?' + document.URL.split('?')[1],
'displayName': 'Account settings'
},
{
'linkUrl': 'Contact.html?' + document.URL.split('?')[1],
'displayName': 'Contact us'
}
]
};
Could anybody provide the whole list of options?
Looking through SP.UI.Controls.Debug.js, here are the options:
siteTitle
siteUrl
clientTag
appWebUrl
onCssLoaded
assetId
appStartPage
rightToLeft
appTitle
appIconUrl
appTitleIconUrl
appHelpPageUrl
appHelpPageOnClick
settingsLinks
language
bottomHeaderVisible
topHeaderVisible
Some of these are provided and managed by the app framework. The type can be inferred by the option name. Unfortunately, there doesn't appear to be a page on MSDN that explains all of the options yet.
I still have the issue where the pager still shows 1 of NaN inspite of the fact that I have downloaded after selecting the grid.formedit.js. Below the comment containing the list of modules added to jquery.jqGrid.min.js.
Blockquote
/* * jqGrid 3.8.2 - jQuery Grid * Copyright (c) 2008, Tony Tomov, tony#trirand.com * Dual licensed under the MIT and GPL licenses * Date:2010-12-14 * Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; jquery.searchFilter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; jqDnR.js; grid.subgrid.js; grid.grouping.js; grid.treegrid.js; grid.import.js; JsonXml.js; grid.setcolumns.js; grid.postext.js; grid.tbltogrid.js; grid.jqueryui.js; */
Blockquote
However, in my case it is when editing the data manually.
The script is as follows:
$('#list').jqGrid(
{
datatype: "xmlstring",
datastr: urlParams,
colNames:[
'Parameter Name',
'Parameter Value'
],
colModel:[ {name:'pName',index:'pName', width:100,editable:true,editoptions: {size:25}},
{name:'pValue',index:'pValue',width:100,editable:true,editoptions:{size:25}}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager',
sortname: 'pName',
viewrecords: true,
sortorder: "desc",
caption:"URL Parameters",
editurl:"<%=request.getContextPath()%>/GenerateXMLResponse.do", //dummy URL
height:210 ,
width:420
} ).navGrid('#pager',{edit:true,add:true,del:true});
The datastr is initialized to an empty xml string as follows:
var defURLParams="<?xml version='1.0' encoding='utf-8'?><urlParams/>";
var urlParams =defURLParams;
Any suggestions would be highly appreciated.
Probably you can solve the problem including total in your data. It is not clear in which form you plan include the data in the XML string used in datastr. You should use xmlReader to describe the data (see documentation for more details). The definition could be xmlReader: {root: "urlParams", ...} (to write more one need know the format of your input data).