我是jqgrid的新手,我通过你的回答学到了很多东西.
现在我遇到了一个问题:我想在向jqgrid添加或修改记录时上传文件?
这是我的代码:
{
name: 'File',
index: 'file',
hidden: true,
enctype: "multipart/form-data",
editable: true,
edittype: 'file',
editrules: {
edithidden: true,
required: true
},
formoptions: {
elmsuffix: '*'
}
}
Run Code Online (Sandbox Code Playgroud)
但是我在控制器中获得的字段总是为空:(.任何建议
任何人都知道工作示例?
在此提前感谢
更新
我在http://tpeczek.codeplex.com/releases上找到了一个非常好的例子
是否可以使用简单成员资格提供程序与mysql(也使用实体框架)
如果是的话,如何实现它.
任何文档/链接都非常感谢
预先感谢
我收到以下错误:"无法找到或加载已注册的.Net Framework数据提供程序." 它只发生在AppHarbor服务器上,而不是我的本地服务器
我使用.Net mvc4和mysql
我已经添加了MySql.Data,MySql.Data.Entity,MySql.Web来引用并设置Copy Local = true.我也将bin文件夹推送到AppHarbor
这是我的web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data>
<connectionStrings>
<add name="fmcdatabaseEntities" connectionString="metadata=res://*/Models.FMCEntityDataModel.csdl|res://*/Models.FMCEntityDataModel.ssdl|res://*/Models.FMCEntityDataModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=****;uid=****;port=3306;database=****"" providerName="System.Data.EntityClient"/>
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0"/>
<add key="webpages:Enabled" value="false"/>
<add key="PreserveLoginUrl" value="true"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
<add key="enableSimpleMembership" value="false"/>
<add key="autoFormsAuthentication" value="false"/>
</appSettings>
<system.web>
<compilation debug="true" …
Run Code Online (Sandbox Code Playgroud) 我有UITableView包含许多单元格.用户可以通过按下此单元格中的展开按钮来扩展单元格以查看此单元格中的更多内容(只有1个单元格可以在时间扩展):
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(selectedRowIndex == indexPath.row) return 205;
else return 60;
}
Run Code Online (Sandbox Code Playgroud)
在故事板中,我将UILongPressGesture拖到单元格按钮并将其命名为longPress(单元格是自定义的,其中有2个按钮,1需要识别LongPressGesture,其他扩展单元格高度):
@property (retain, nonatomic) IBOutlet UILongPressGestureRecognizer *longPress;
Run Code Online (Sandbox Code Playgroud)
并在viewDidLoad中:
- (void)viewDidLoad
{
[longPress addTarget:self action:@selector(handleLongPress:)];
}
Run Code Online (Sandbox Code Playgroud)
它完美地工作,但是当我使用以下代码识别单元格索引路径时,在展开一个单元格时出错:
- (void)handleLongPress:(UILongPressGestureRecognizer*)sender {
// Get index path
slidePickerPoint = [sender locationInView:self.tableView];
NSIndexPath *indexPath= [self.tableView indexPathForRowAtPoint:slidePickerPoint];
// It's wrong when 1 cell is expand and the cell's button I hold is below the expand button
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我如何在不同的单元格高度时获得正确的indexPath?
预先感谢