我有一个带有3个标签的模态.每个选项卡都有一个列表视图,任何大于10行的数据集都无法正常工作.发生的是初始加载它正确显示.但是当显示更多行时,它们都是空的.不确定发生了什么.使用最新的React-Native.如果它有帮助,这里有几个截图.
<View style={{flex:1, height: this.state.visibleHeight - 100, width: this.state.visibleWidth }}>
{
(this.state.isSubdivisions) ? <Subdivisions model={this.props.model.subdivisions}/>
: (this.state.isProspects) ? <LandProspects model={this.props.model.landProspects}/>
: (this.state.isFavorites) ? <Favorites model={this.props.model.favorites}/>
: null}
</View>
Run Code Online (Sandbox Code Playgroud)
标签
class ListLandProspects extends Component {
constructor(props) {
super(props);
const foo = this.props.model.slice(0,10)
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})
this.state = {
dataSource: ds.cloneWithRows(foo),
deviceHeight: Dimensions.get('window').height,
deviceWidth: Dimensions.get('window').width
}
}
componentDidUpdate(prevProps) {
if (this.props.model != prevProps.model)
this._updateLandProspects()
}
_updateLandProspects(){
const clone = this.props.model.slice()
this.setState({
dataSource: this.state.dataSource.cloneWithRows(clone)
}) …Run Code Online (Sandbox Code Playgroud) 我想升级到持续稳定的角度分支1.4.7.我来自1.2.13.我的项目中有一个为应用程序定制的angular-leaflet-directive.我试图弄清楚如何更改函数中的语法,以便它不会引发错误.控制台消息
Error: [$parse:syntax] Syntax Error: Token '.50465' is an unexpected token at column 8 of the expression [markers.50465] starting at [.50465].
http://errors.angularjs.org/1.4.7/$parse/syntax?p0=.50465&p1=is%20an%20unexpected%20token&p2=8&p3=markers.50465&p4=.50465
at angular.js:68
at Object.AST.throwError (angular.js:13057)
at Object.AST.ast (angular.js:12827)
at Object.ASTCompiler.compile (angular.js:13276)
at Parser.parse (angular.js:14146)
at $parse (angular.js:14248)
at Scope.$watch (angular.js:15412)
at createMarker (angular-leaflet-directive.js:1496)
at Object.fn (angular-leaflet-directive.js:1158)
at Scope.$digest (angular.js:15826)(anonymous function) @ angular.js:12477(anonymous function) @ angular.js:9246Scope.$digest @ angular.js:15844Scope.$apply @ angular.js:16097done @ angular.js:10546completeRequest @ angular.js:10744requestLoaded @ angular.js:10685
Run Code Online (Sandbox Code Playgroud)
功能错误在'标记'处.
// add new markers
for (var new_name in newMarkers) {
if (markers[new_name] …Run Code Online (Sandbox Code Playgroud) 我正在使用react-native-router-flux为我的应用程序主导航.我需要设置一个嵌套路由器.我有一个地图组件,其侧栏有一个区域列表.当我单击一行时,我需要切换到具有属于该区域的细分列表的视图.我看了一些例子并试图弄明白.目前在控制台中没有错误,但侧边栏中没有显示任何内容.如果有更好的方法,请告诉我.谢谢!
Maprouter
export default class RootRouter extends Component {
render() {
return(
<Router hideNavBar={true}>
<Schema name="default" sceneConfig={Navigator.SceneConfigs.FloatFromRight}/>
<Route name="mapSurveyTerritories" wrapRouter={false} component={MapSurveyTerritories} initial={true}/>
<Route name="mapSubdivisions" wrapRouter={false} component={MapSubdivisions} />
</Router>
);
}
}
Map Component
BackAndroid.addEventListener('hardwareBackPress', function() {
Actions.pop();
return true;
});
export default class Map extends Component {
constructor(props) {
super(props);
this.state = {
region: Albuquerque,
};
}
render() {
const { region, markers,surveyTerritories,selectedMarket } = this.state;
return (
<View style={styles.container}>
<Navbar
title="Map"/>
<View style={styles.innerContainer}>
<MapView
style={styles.map}
initialRegion={region}
onLongPress={this.onPress.bind(this)}>
{markers.map(marker => …Run Code Online (Sandbox Code Playgroud) 我试图将Id推入Json对象数组.每个对象必须有'"JobId":Value'在发送到apiController之前插入.我试图使用forEach循环,但我被卡住了.现在不是在数组中的每个对象中插入它而是插入数组的末尾.我有一个plunkr设置. plunkr
$scope.array = [{
ESOURCELINEID:"5464",
QBRFQLINESUPPLIERPARTNUMBER:"HW12",
QBRFQLINESUPPLIERQUOTEUOM:"ft"
}, {
ESOURCELINEID:"8569",
QBRFQLINESUPPLIERPARTNUMBER:"LT34",
QBRFQLINESUPPLIERQUOTEUOM:"Meter"
}];
var JobId = 143;
$scope.array.forEach(function (newJobItem) {
$scope.array.push({'JobId' : JobId});
});
var index = 0;
$scope.array.forEach(function (newJobItem) {
console.log('newJobItem #' + (index++) + ': ' + JSON.stringify(newJobItem));
});
Run Code Online (Sandbox Code Playgroud) 我正在使用PDFsharp导出图表图例.我使用for循环和表来显示属性.实际上只有一个属性:Subdivision名称.该对象具有正确的RGB颜色.如图表图例显示系列那样,如何在它旁边绘制正方形?请原谅我的变量名,我要举个例子.
//Writting Table Header Text
textformater.DrawString(" Color", tableheader, XBrushes.Black, snoColumn);
textformater.DrawString(" Subdivision Name", tableheader, XBrushes.Black, snoStudentName);
foreach (var item in data)
{
y = y + 30;
XRect snoColumnVal = new XRect(35, y, 70, height);
XRect snoStudentNameVal = new XRect(100, y, 250, height);
textformater.DrawString(item.Color, tableheader, XBrushes.Black, snoColumnVal);
textformater.DrawString(item.Name, tableheader, XBrushes.Black, snoStudentNameVal);
}
Run Code Online (Sandbox Code Playgroud)
这是输出:

这就是我需要的样子

我的 React 视图中有 3 个 handsontables。当用户水平和垂直滚动时,我需要同步它们。我试图使用 javascript 来横向工作,但没有任何运气。
import React from 'react';
import ReactDOM from 'react-dom';
const handsontableData = Handsontable.helper.createSpreadsheetData(6, 50);
const Table1 = () => (
<div>
<Handsontable.react.HotTable
id="T1"
data={handsontableData}
colHeaders
rowHeaders
colWidths={[100]}
height={200}
width="100vw"
/>
</div>
);
const Table2 = () => (
<div>
<Handsontable.react.HotTable
id="T2"
data={handsontableData}
colHeaders
rowHeaders
colWidths={[100]}
height={200}
width="100vw"
/>
</div>
);
const Table3 = () => (
<div>
<Handsontable.react.HotTable
id="T3"
data={handsontableData}
colHeaders
rowHeaders
colWidths={[100]}
height={200}
width="100vw"
/>
</div>
);
const App = () => …Run Code Online (Sandbox Code Playgroud)我正在尝试使用Angular/bootstrap模式来编辑MVC ApplicationUser脚手架视图.我找到了一些例子,它们大多是jquery.我发现一个使用jquery-ui运行良好.我希望与我的模态保持一致,所以我需要使用angular-ui或plain bootstrap.我不确定这是如何调用MVC控制器进行数据绑定的.
使用Jquery-ui示例
<script type="text/javascript">
$(document).ready(function () {
$.ajaxSetup({ cache: false });
$(".editDialog").live("click", function (e) {
var url = $(this).attr('href');
$("#dialog-edit").dialog({
title: 'Edit Customer',
autoOpen: false,
resizable: false,
height: 355,
width: 400,
show: { effect: 'drop', direction: "up" },
modal: true,
draggable: true,
open: function (event, ui) {
$(this).load(url);
},
});
$("#dialog-edit").dialog('open');
return false;
});
});
Run Code Online (Sandbox Code Playgroud)
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.FullName)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.Id }, new …Run Code Online (Sandbox Code Playgroud) 我有一个firebase身份验证令牌,我试图传递给web api控制器.我在这里关注这篇文章.stackoverflowpost
我照顾了科尔(除非我错过了什么).我的api项目的终点是接收带有null头的请求.所以我试图调试错误但没有任何具体错误,我不知道在哪里看

使用"react-router":"^ 3.0.2",
当我重新加载页面时,我需要它转到它当前正在执行的默认视图.但是,历史记录中的实际路径仍然与我刷新时的路径相同.因此,该组件在不应该的时候进行重新安装.
路由历史
export const browserHistory = useRouterHistory(useBeforeUnload(createHistory))()
Run Code Online (Sandbox Code Playgroud)
路线
<Router history={browserHistory}>
<Route path='/' name='Auth' component={Auth}>
<IndexRoute
component={Dashboard}
onEnter={(nextState, replace) => replace('/login')} />
<Route path='dashboard' name='Dashboard' component={Dashboard} />
<Route path='resources' name='Resources' component={Resources} />
<Route path='users' name='Users' component={UsersContainer} />
<Route path='user/:params' name='User' component={UserContainer} />
</Route>
<Route path='/' name='NoAuth' component={NoAuth}>
<Route path='login' name='Login Page' component={Login} />
</Route>
</Router>
Run Code Online (Sandbox Code Playgroud)
这是我检查用户是否仍然拥有有效会话令牌以及如何重新路由到仪表板的方法.不确定我是否这样做是最好的方式.
const _checkAuth = () => {
if (profile) {
const res = JSON.parse(profile)
store.dispatch({ type: types.LOGIN_IDENTITY_SUCCESS, res })
console.log(browserHistory.getCurrentLocation().pathname)
router.replace('/dashboard')
}
}
_checkAuth()
Run Code Online (Sandbox Code Playgroud) javascript ×5
reactjs ×5
angularjs ×4
jquery ×2
react-native ×2
asp.net-mvc ×1
c# ×1
d3.js ×1
handsontable ×1
listview ×1
pdfsharp ×1
react-router ×1
reactjs-flux ×1
svg ×1
syntax-error ×1
token ×1