小编Abr*_*hin的帖子

jQuery DataTables - 自定义列Visiblity

我喜欢使用jQuery DataTable插件,并希望创建类似这样的东西 -

一

当任何人点击"列可见性"按钮时,他们会看到这样的情况 -

万维网

但是我不喜欢将全局搜索按钮和分页放在首位(因为我已经在底部加入了分页).

我只想要那个按钮.

所以,我所做的是 -

$(document).ready(function()
{
var dataTable =  $('#employee-grid').DataTable(
{
    processing: true,
    serverSide: true,
    //ajax: "employee-grid-data.php", // json datasource for AJAX Data

    "ajax":
    {
        "url": "employee-grid-data.php",
        //"type": 'POST',
        "data": function ( d )              //Sending Custom Data for manupulating with elements out of the table
                {
                    d.myKey = "myValue";
                    // d.custom = $('#myInput').val();
                    // etc
                },
    },

    //"pagingType": "full_numbers", //Adding Last and First in Pagination
    stateSave: true,
    "language":{                    //Custom …
Run Code Online (Sandbox Code Playgroud)

javascript jquery datatables

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

使用 Stash rest api 拉取请求

我正在尝试使用 rest API 创建拉取请求。我浏览了文档。我正在使用以下 json 执行文档中提到的发布请求

{
 "title": "blah blah", 
 "description": "blah blah",  
 "state": "OPEN",  "open": true,  
 "closed": false, 
 "fromRef":
    {
        "id": "feature/test1",
        "repository":
            {
                "slug": "test-repo",
                "name": null,
                "project":
                    {
                        "key": "PR"
                    }
            }
      }, 
 "toRef":
     {
         "id": "refs/heads/master",
         "repository":
             {
                 "slug": "test-repo",
                 "name": null,
                 "project":
                    {
                        "key": "PR"
                    }
             }
      }, 
"locked": false,  
"reviewers": [
                 {
                     "user":
                          {
                              "name": "nikhil"
                          }
                 }
             ]
}
Run Code Online (Sandbox Code Playgroud)

但我收到一个错误响应

{
    "errors":
      [
         {
             "context":"type","message":"Please enter a type of permission","exceptionName":null
         }, …
Run Code Online (Sandbox Code Playgroud)

rest json bitbucket-server

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

Android WebView 不显示任何内容

我正在尝试使用 webView 在 android 应用程序中显示 URL。

如果我尝试使用此 URL-

http://stackoverflow.com

我得到这个- 在此处输入图片说明

但是,如果我尝试这样做-

https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F8111706%3Fsecret_token%3Ds-3aK27&color=e2ef3a&auto_play=false&show_artwork=false

我得到这个-

在此处输入图片说明

我所做的是——

活动-

package com.appnucleus.abrarjahin.hello8920;

import android.content.Context;
import android.net.ConnectivityManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.Toast;

public class ActivityMain extends AppCompatActivity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        if ( isNetworkAvailable() )     //check if internet available or not
        {
            Toast.makeText(
                                ActivityMain.this,
                                "Internet Connected",
                                Toast.LENGTH_LONG
                            ).show();
            WebView webview = (WebView)findViewById(R.id.webView);
            webview.getSettings().setJavaScriptEnabled(true);
            webview.loadUrl(getString(R.string.sound_cloud_url));
        }
        else    //Not connected
        {
            Toast.makeText(
                    ActivityMain.this,
                    "Internet Disconnected",
                    Toast.LENGTH_LONG
            ).show();
        }
    } …
Run Code Online (Sandbox Code Playgroud)

android webview

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

Laravel Query Builder - 其中(1 = 1)出错

我正在尝试将此PHP MySQL查询构建到Laravel Query构建器:

$sql = "SELECT employee_name, employee_salary, employee_position, employee_city, employee_extension, DATE_FORMAT(employee_joining_date, '%Y-%m-%d') as employee_joining_date, employee_age ";
$sql .= " FROM employee WHERE 1=1";
if (!empty($EmployeeNameSeach) ) {
    $sql .=" AND  employee_name LIKE '".$EmployeeNameSeach."%' ";    
}
if (!empty($SalarySeach)) {
    $sql .= " AND  employee_salary LIKE '".$SalarySeach."%' ";
}
if (!empty($PositionNameSeach) ) {
    $sql .= " AND  employee_position LIKE '".$PositionNameSeach."%' ";
}
if (!empty($CitySeach) ) {
    $sql .= " AND  employee_city LIKE '".$CitySeach."%' ";
}
if (!empty($ExtensionSeach) ) {
    $sql .= …
Run Code Online (Sandbox Code Playgroud)

php query-builder laravel laravel-4 laravel-5

0
推荐指数
1
解决办法
2875
查看次数

使div水平和垂直居中

我是twitter bootstrap 3的新手.

我尝试将div水平和垂直居中.

我所做的是 -

<!-- Content -->
    <div class="container outer_container">
        <div class="inner_container">
            <h1>Jumbotron heading</h1>
            <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
        </div>
    </div>
    <!-- End Content -->
Run Code Online (Sandbox Code Playgroud)

HTML代码.

CSS代码是 -

    .outer_container
    {
    position:absolute !important;
    height:100% !important;
    width:100% !important;
       display: table !important;
   }

   .inner_container
   {
       display: table-cell !important;
       vertical-align: middle !important;
       text-align:center !important;
   }
Run Code Online (Sandbox Code Playgroud)

并且它提供了类似的输出 - 输出1

但是如果我添加一个col-sm-4 …

html css twitter-bootstrap twitter-bootstrap-3

-1
推荐指数
1
解决办法
151
查看次数

Android - 在Fragment中使用SharedPrefs

我正在尝试使用共享首选项.

我已经创建了一个类 -

package com.bscheme.linkkin.utils;

import android.content.Context;
import android.content.SharedPreferences;
import com.bscheme.linkkin.R;

public class SharedDataSaveLoad {

    public static void save(Context context, String key, String value) {
        SharedPreferences sharedPreferences = context.getSharedPreferences(context.getResources().getString(R.string.preference_file_key),Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString(key, value);
        editor.commit();
    }
    public static void save(Context context,String key, int value) {
        SharedPreferences sharedPreferences = context.getSharedPreferences(context.getResources().getString(R.string.preference_file_key),Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putInt(key, value);
        editor.commit();
    }

    public static String  load(Context context, String key) {
        SharedPreferences sharedPreferences = context.getSharedPreferences(context.getResources().getString(R.string.preference_file_key), Context.MODE_PRIVATE);
        return sharedPreferences.getString(key, "");
    }
    public static int loadInteger(Context context,String …
Run Code Online (Sandbox Code Playgroud)

android sharedpreferences android-fragments

-1
推荐指数
1
解决办法
325
查看次数