问题列表 - 第41869页

jqGrid客户端搜索

我想通过JavaScript手动将搜索应用到我的jqGrid.我在这里尝试了一个指南,但似乎无法让它完全正常工作.在网格设置中,我有一个名为'error_column'的列,我想在搜索字符串'Test'时执行搜索.

这是我到目前为止:

var filter = { "field": "error_column", 'oper': 'eq', "data": 'Test' };
$("Grid2").jqGrid('setGridParam', { search: true, postData: { filters: filter} })
$("Grid2").trigger('reloadGrid');
Run Code Online (Sandbox Code Playgroud)

当我单击这个绑定的按钮时,没有任何反应,它不会导致错误.

编辑 以下是初始化网格的代码:

jQuery("#Grid2").jqGrid({
    datatype: "local",
    height: 250,
    colNames: ['NewSubscriberID', 'Conflicting Subscriber ID', 'Error Field', 'Error Message'],
    colModel: [
        { name: 'new_subscriber_id', index: 'new_subscriber_id', width: 120},
        { name: 'conflicting_subscriber_id', index: 'conflicting_subscriber_id', width: 170},
        { name: 'error_column', index: 'error_column', width: 90, sorttype: "text", search: true},
        { name: 'error_type', index: 'error_type', width: 145}
    ],
    loadonce: true
    }); …
Run Code Online (Sandbox Code Playgroud)

client-side jqgrid

3
推荐指数
1
解决办法
2万
查看次数

选择数据结构

根据需要使用不同的数据结构,但我如何知道应该使用哪种数据结构?我只是想知道如何选择合适的数据结构?谢谢

c

2
推荐指数
1
解决办法
2842
查看次数

'git'不被识别为内部或外部命令

我安装了Git for Windows,但是当我尝试git在命令提示符中使用该命令时,我收到以下错误:

'git' is not recognized as an internal or external command,
operable program or batch file. 
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

windows git path environment-variables command-prompt

337
推荐指数
10
解决办法
54万
查看次数

以编程方式"取消选择"jQuery UI可选小部件

有没有办法以编程方式"取消选择"给定$("#selectable").selectable()窗口小部件的任何和所有选定元素?

jquery jquery-ui jquery-ui-selectable

9
推荐指数
1
解决办法
8532
查看次数

调用 ContextMenu 以打开

我需要做一些像谷歌地图做的事情(但在WPF):

  • RightClick地图上时,我有一个 ContextMenu。
  • RightDoubleClicking我有 UnZoom 动作时。

所以,显然,这在 WPF 中有点困难......在挣扎和搜索了很多之后,阅读了那些“我们无法预测未来”的人(我问自己谷歌是如何预测的),我决定“等待“ SystemInformation.DoubleClickTime,然后才显示上下文菜单。

当然,这不是理想的,甚至人类可观察到的,但我不知道其他方法。

所以,我对以下代码的问题是(我有一个自定义画布):

ContextMenuEventArgs lastContextMenuEventArgs = null;
bool? lastContextMenuEventArgsHandled = null;

protected override void OnContextMenuOpening(ContextMenuEventArgs e)
{
    lastContextMenuEventArgs = e;
    lastContextMenuEventArgsHandled = e.Handled;

    e.Handled = true;
    //base.OnContextMenuOpening(e);
}

bool rightMouseClickedOnce = false;
protected override void OnPreviewMouseRightButtonUp(MouseButtonEventArgs e)
{
    //base.OnPreviewMouseRightButtonUp(e);

    Console.WriteLine(">>>>>>>>>>> OnPreviewMouseRightButtonUp");
    if (!rightMouseClickedOnce)
    {
        rightMouseClickedOnce = true;
        Thread thread = new Thread(
            new System.Threading.ThreadStart(
                delegate()
                {
                    Thread.Sleep(System.Windows.Forms.SystemInformation.DoubleClickTime);
                    this.Dispatcher.Invoke(
                        System.Windows.Threading.DispatcherPriority.Background,
                        new Action(
                            delegate()
                            {
                                if …
Run Code Online (Sandbox Code Playgroud)

.net wpf contextmenu click double-click

5
推荐指数
0
解决办法
578
查看次数

从字符串中删除\ r \n

我有一些字符串中的Html我已尽力删除\ r很多次但失败了.

text.Replace("\r\n", "").Replace("\r", "").Replace("\n", "");
Run Code Online (Sandbox Code Playgroud)

c# string

15
推荐指数
1
解决办法
3万
查看次数

Rails:Factory Girl无法排序

刚刚开始工厂女孩,我遇到了排序问题:具体来说,它没有增加.我已经尝试更改数据库类型,从factory_girl 1.3.2更新到2.0.0.beta1(并且factory_girl_rails从1.0更新到1.1.0.beta1),尝试重新创建数据库,但同样的问题 - 序列不会增加和第一次插入唯一字段后,我收到验证错误.

任何协助非常感谢.代码和跟踪堆栈如下:

/spec/models/user.rb

require 'spec_helper'

describe User do   describe "test user factory is correct" do
    user = Factory(:user)

    it "should have an email ending in example.com" do
      #user.email.should match "test2@example.com"
    end

    it "should have a password of foobar" do
      user.password.should == 'foobar'
    end

    it "should have a password confirmation field of foobar" do
      user.password_confirmation.should == 'foobar'
    end
    end

end
Run Code Online (Sandbox Code Playgroud)

/spec/factories/user.rb

Factory.define :user do |f|
    f.sequence(:email) { |n| puts "Email ##{n}"; "factory_#{n}@example.com" }
    f.password 'foobar'
    f.password_confirmation { |p| …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails factory-bot

6
推荐指数
2
解决办法
9337
查看次数

Akka的好用例

我听说过很多关于Akka框架(Java/Scala服务平台)的狂热,但到目前为止还没有看到很多用例的实际例子.所以我有兴趣听听开发人员成功使用它的事情.

只有一个限制:请不要包括编写聊天服务器的情况.(为什么?因为这被过度使用作为许多类似事物的一个例子)

java asynchronous scala use-case akka

596
推荐指数
12
解决办法
17万
查看次数

成功重定向并在失败时显示错误

我已经实现了一个控制器来创建新用户.当它成功创建用户时,它会重定向到Index().

我想要的是在一切正常时重定向,但留在当前页面并在出现故障时看到错误.

我使用的是jQuery ajaxMVC.

我的控制器看起来像这样:

[Authorize]
public ActionResult CreateUser(string username)
{
    try
    {
        //here the logic to create the user
    }   
    catch (Exception ex)
    {
        string error = string.Format("Error creating user: {0}", ex.Message);
        Response.StatusCode = 500;
        Response.Write(error);    
    }
    return RedirectToAction("Index");
}
Run Code Online (Sandbox Code Playgroud)

使用jQuery拦截表单提交,然后使用ajax进行调用:

$("#new-user-form").submit(function() {
    var form = $(this);
    $.ajax({
    type: "GET",
        url: form.attr('action'),
        data: form.serialize(),
        success: function(data, textStatus, xhr) {
            //At this point I would like to redirect
        },
        error: …
Run Code Online (Sandbox Code Playgroud)

ajax asp.net-mvc jquery asp.net-mvc-2

10
推荐指数
1
解决办法
2万
查看次数

立即触发setInterval内的匿名函数

所以我有一个看起来像这样的计时器

my_timer = setInterval(function(){
    do_something_amazing();
    do_more.stuff_here();
    var etc_etc = "foo" + bar;
}, 1000);
Run Code Online (Sandbox Code Playgroud)

我希望它立即运行,之后每秒运行一次.我尝试将appending()附加到函数的末尾,但这导致它只运行一次(因为它没有将函数本身返回到setInterval?).然后我尝试了return this;它可能会返回函数本身,但这也没有好处.这是随机猜测.

有没有办法在不创建命名函数的情况下让它工作?谢谢!

javascript anonymous-function setinterval

2
推荐指数
1
解决办法
1475
查看次数