小编ind*_*ago的帖子

如何在数据库,websockets或长轮询实现中记录更改时不断更新数据表

我在webapp上使用datatables作为我的网格.问题是,用户必须始终刷新页面以从数据库中获取当前数据,有没有办法可以自动完成?因为有几个应用程序写入同一个表,而webapp仅用于监控,但如果用户必须刷新页面以获取当前数据,它就会失败.这是我的初始化代码:

  $('.{{datatable['class']}}').dataTable( {
                "sDom": 'T<"clear">lfrtip',
                "oTableTools": {
                    "sSwfPath": "includes/swf/copy_csv_xls_pdf.swf",                
                    "aButtons": [
                         { 
                             "sExtends":"copy",
                             "mColumns":[{{datatable['flds']}}]
                         },
                         {   
                             "sExtends":"csv",
                             "mColumns":[{{datatable['flds']}}]
                         },

                         {
                             "sExtends":"xls",
                             "mColumns":[{{datatable['flds']}}]
                         },                         
                         {
                            "sExtends": "pdf",
                            "mColumns":[{{datatable['flds']}}],
                            "sPdfOrientation": "landscape",
                            "sPdfMessage": "{{datatable['title']}}"
                         }
                    ]
                    },        
                "bProcessing": true,
                "bServerSide": true,
                "sAjaxSource": "{{datatable['source']}}",
                "aoColumns": [          
                        {% for column in 0..datatable['columns']-2 %}
                        null,
                        {% endfor %}
                        null
                ]

        });
Run Code Online (Sandbox Code Playgroud)

有没有一种方法,每当数据源发生任何事情(UPDATE/INSERT/DELETE)时,列表可以自行更新?我已经实现了Danny建议的循环,

var int=self.setInterval(function(){oTable.fnDraw();},1000);
Run Code Online (Sandbox Code Playgroud)

但问题是列表总是一个有趣的状态,看到附着的图像在此输入图像描述

jquery datatables long-polling websocket phpwebsocket

5
推荐指数
1
解决办法
1854
查看次数

VS2019的Crystal Reports

我已经在新PC上安装了VS2019。我尝试安装Crystal Reports,Microsoft Visual Studio的开发人员版本,CRforVS_13_0_24但无法安装,但出现以下错误 在此处输入图片说明

VS2019是否有版本?还是有办法让VS2019使用Crystal Report?提前致谢!

crystal-reports visual-studio

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

在 cakephp 模型中验证比较两个字段

我有一个模型 Interesttype,我想要验证两个字段,一个不应该多于另一个,并且没有一个应该小于特定的设置值。这是我的模型。

    class Interesttype extends AppModel
    {
      public $primaryKey = 'int_id';
      public $displayField = 'int_name';
      public $hasMany= array(
            'Loan' => array(
                'className' => 'Loan',
                'foreignKey' => 'lon_int_id'            
            )
        );
      public $validate = array(
            'int_name'=> array(
                    'rule' => 'notEmpty',
                    'allowEmpty' => false,
                    'message' => 'The interest type name is required.'
                    ),
          'int_active'=>array(
                     'rule'=>array('boolean'),
                     'allowEmpty'=>false,
                     'message'=>'Please select the status of this interest type'
                     ),
           'int_max'=> array(
                    'numeric'=>array(
                        'rule' => 'numeric',
                        'allowEmpty' => false,
                        'message' => 'Please specify a valid maximum interest rate.' …
Run Code Online (Sandbox Code Playgroud)

php validation cakephp

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

南希自我托管者返回404

我有一个控制台应用程序,我想使用Nancy托管Web服务。这是我的Program.cs

namespace NancyConsole
{
    using Nancy.Hosting.Self;
    using System;
    internal class Program
    {
        private static void Main(string[] args)
        {
            string url = "http://localhost:1234";
            var host = new NancyHost(new Uri(url));
            host.Start();
            Console.WriteLine("Server started, now listening on " + url);
            Console.WriteLine("Press any key to stop the server...");
            Console.ReadKey();
            host.Stop();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的MainModule.cs文件

namespace NancyConsole
{
    using Nancy;
    internal class MainModule : NancyModule
    {
        public MainModule()
        {
            Get["/"] = x => View["Views/index.html"];
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的项目结构 项目结构

当我运行项目时,这是我在浏览器上看到的错误 错误信息

我不知道我要去哪里错了?非常感谢您的帮助!

c# self-hosting nancy

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

cakephp形式的多个提交按钮

我在cakephp视图中有一个表单,只需一个按钮即可保存,这里是视图book_form.ctp中的代码

echo $this->Form->create
(
    'Book',
    array
    (
        'url' => array
        (
            'controller' => 'Books',
            'action'     => 'save_record'
        ),
        'class'         => 'span12 the_ajaxform',
        'inputDefaults' => array
        (
            'label' => false,
            'error' => false
        )
    )
); 
.
.
// form fields
.
.
$options =array(
    'label' => __('Save'),
    'class' => 'btn btn-primary',
     'id'=>'saveform'   
 );
echo $this->Form->end($options);
.
.
Run Code Online (Sandbox Code Playgroud)

这完美!现在我想在该表单上添加两个按钮,这就是我所做的

$options =array(array(
        'label' => __('Save & Close'),
        'class' => 'btn btn-primary',
         'id'=>'saveform'   
     ),
     array(
        'label' => __('Save & Create New'),
        'class' => …
Run Code Online (Sandbox Code Playgroud)

php forms jquery cakephp cakephp-2.3

0
推荐指数
2
解决办法
9719
查看次数