7.5.3 • Published 6 years ago

jquery.ajax-combobox v7.5.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

jquery.ajax-combobox

npm version Build Status

jQuery plugin to create a text box which can auto-complete and pull-down-select.

image

Demo

https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/

Install

Usage

HTML
<link rel="stylesheet" href="jquery.ajax-combobox.css">

<input type="text" id="foo">

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="jquery.ajax-combobox.min.js"></script>
JavaScript
$('#foo').ajaxComboBox('jquery.ajax-combobox.php');

Note

Database

Change the value to connect DB in dist/php/jquery.ajax-combobox.php

<?php
//++++++++++++++++++++++++++++++++++++++++++++++++++++
//#### You MUST change this value. ####
$mysql = array(
  'dsn'      => 'mysql:host=localhost;dbname=acbox;charset=utf8',
  'username' => 'root',
  'password' => ''
);
$sqlite = array(
  'dsn'      => 'sqlite:../sample/sample.sqlite3',
  'username' => '',
  'password' => ''
);
new AjaxComboBox($sqlite);
//++++++++++++++++++++++++++++++++++++++++++++++++++++
?>

Options

  • 1st arg (string|Object): Server side file such as PHP. Or an object of data
  • 2nd arg (Object): Options
Combobox
OptionTypeInitialExplain
langstring'en'Language for this plugin's UI (en, es, pt-br and ja)
db_tablestring'tbl'Table of database to query
fieldstring'name'Field of table to display on result
search_fieldstring=fieldField of table to search. Accept comma separated string. (e.g.: 'id, name, job')
order_bymixed=search_fieldField for sorting (e.g. 'name DESC', ['name ASC', 'age DESC']).ASC or DESC should be UPPERCASE.
and_orstring'AND'Boolean searching ('AND', 'OR')
per_pagenumber10Amount of items per page
navi_numnumber5Amount of page-link on navi
navi_simplebooleanfalseEnable simple navi to narrow as possible
plugin_typestring'combobox'Choose 'combobox', 'simple', 'textarea'
bind_tostringnullEvent to run after selecting
button_imgstringOcticonsImage for "Get All" button. Accept HTML element, src attribute
Sub-info
OptionTypeInitialExplain
sub_infomixedfalseDisplay sub-info (true, false, 'simple')
sub_asObject{}Alias for fields of sub-info
show_fieldstringnullField to display on sub-info. Accept comma separated. ('id, job, age')
hide_fieldstringnullField to hide on sub-info. Accept comma separated. ('id, job, age')
Select-only
OptionTypeInitialExplain
select_onlybooleanfalseForce only selecting
primary_keystring'id'Primary-key to use "select only" mode
init_recordnumbernullValue of primary-key for initial value
instancebooleanfalseReturn instance instead of jQuery object
Textarea
OptionTypeInitialExplain
tagsArraynullOptions for searching tags
tags.patternArraynullA pair of start symbol and end symbol to surround a tag
tags.spaceArraytrue, trueInsert space automatically ahead start symbol and behind end symbol
tags.db_tablestring=db_table
tags.fieldstring=field
tags.search_fieldstring=search_field
tags.order_bymixed=order_by
tags.sub_infomixed=sub_info
tags.sub_asObject=sub_as
tags.show_fieldstring=show_field
tags.hide_fieldstring=hide_field
Shorten URL
OptionTypeInitialExplain
shorten_btnstringnullCSS selector of the button to shoten url
shorten_srcstring'dist/bitly.php'Path to the script to shorten url
shorten_minnumber20Minimum characters to run shortening url
shorten_regObjectnullRegExp object to detect url in the textarea

Extensions

Forked

License

MIT

Author

Yuusaku Miyazaki ( toumin.m7@gmail.com )

7.5.3

6 years ago

7.5.2

6 years ago

7.5.1

6 years ago

7.5.0

7 years ago

7.4.7

7 years ago

7.4.6

7 years ago

7.4.5

7 years ago