我在执行2 nsfetchedresultsController中遇到困难tableView.我想在表的每个部分(2个部分)中使用fetchedresultsController,如下所示:
收藏
买
我知道对于这个例子我不需要2 nsfetchedResultsController但我稍后会需要它.
当我从一个nsfetchedResultsController删除一个产品,它传递给另一个,我得到这个错误:
无效更新:第0节中的行数无效.更新(0)后现有部分中包含的行数必须等于更新前的该部分中包含的行数(0),加上或减去数字从该部分插入或删除的行数(插入1个,删除0个).with userInfo(null)"
我认为这是因为当第一个fetchedRController检测到更改时,它会在第二个调用之前更新tableView,是吗?我应该使用NSMutableArrays并手动更新tableView吗?
代码:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSInteger numberOfRows = 0;
switch (section)
{
case WISHLIST_SECTION:
{
numberOfRows =[[fetchedResultsControllerwish fetchedObjects]count];
};
break;
case PURCHASED_SECTION:
{
numberOfRows =[[fetchedResultsControllerPurchased fetchedObjects]count];
};
break;
default:
break;
}
return numberOfRows;
}
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller {
// The fetch controller is about to start sending change notifications, so prepare the table view for updates.
[self.tableView beginUpdates];
}
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
{ …Run Code Online (Sandbox Code Playgroud) iphone uitableview nsmutablearray nsfetchedresultscontroller
我目前正在测试Kendo UI MVC Extensions Beta.我正在尝试实现双击 - 编辑,但我不知道如何获得rowId.
JavaScript的:
$('#GridPedidos table tr').live('dblclick', function () {
alert(' grid dbl clicked');
});
Run Code Online (Sandbox Code Playgroud)
视图:
@(Html.Kendo().Grid(Model) _
.Name("GridPedidos") _
.Columns(Sub(column)
column.Bound(Function(item) item.idPedidoDocumentacao).Width("5%")
column.Bound(Function(item) item.descEstadoPedidoDoc).Width("25%")
column.Bound(Function(item) item.descTipoPedidoDoc).Width("25%")
column.Bound(Function(item) item.data).Width("25%").Format("{0:dd-MM-yyyy}")
column.Command(Function(item) item.Destroy()).Width("10%")
End Sub) _
.DataSource(Sub(ds)
ds.Ajax().ServerOperation(False).Read(Sub(s)
s.Action("GetListaGrid", "listaPedidos")
End Sub).Create(Sub(s)
s.Action("detalhePedido", "Pedidos")
End Sub).Model(Sub(m)
m.Id(Function(p) p.idPedidoDocumentacao)
End Sub).Destroy(Sub(d)
d.Action("apagaPedido", "listaPedidos")
End Sub)
End Sub) _
.Selectable()
)
Run Code Online (Sandbox Code Playgroud)
我可以通过此功能检测到双击,但我如何获取ID?
asp.net-mvc ×1
iphone ×1
javascript ×1
kendo-grid ×1
kendo-ui ×1
telerik-grid ×1
uitableview ×1