summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHalil İbrahim Kalkan <hikalkan@gmail.com>2016-04-14 09:19:12 +0300
committerHalil İbrahim Kalkan <hikalkan@gmail.com>2016-04-14 09:19:12 +0300
commit1a6e6ab44e57f1cea35a1b7168a8c8ef319d5a81 (patch)
tree9ddf7d877a70cc5f083e71783a45bbdc30d987a3
parentbb411ad5918122d48ec4bb2dbf87d22e1d5692f1 (diff)
parent63474995e8cff7b193d9db357edcfd31797b7341 (diff)
downloadjtable-1a6e6ab44e57f1cea35a1b7168a8c8ef319d5a81.zip
jtable-1a6e6ab44e57f1cea35a1b7168a8c8ef319d5a81.tar.gz
jtable-1a6e6ab44e57f1cea35a1b7168a8c8ef319d5a81.tar.bz2
Merge pull request #1927 from biehlermi/add-placeholder
Add placeholder support
-rw-r--r--dev/jquery.jtable.core.js3
-rw-r--r--dev/jquery.jtable.forms.js4
2 files changed, 5 insertions, 2 deletions
diff --git a/dev/jquery.jtable.core.js b/dev/jquery.jtable.core.js
index 94db25c..105f419 100644
--- a/dev/jquery.jtable.core.js
+++ b/dev/jquery.jtable.core.js
@@ -138,6 +138,9 @@
if (props.inputClass == undefined) {
props.inputClass = '';
}
+ if (props.placeholder == undefined) {
+ props.placeholder = '';
+ }
//Convert dependsOn to array if it's a comma seperated lists
if (props.dependsOn && $.type(props.dependsOn) === 'string') {
diff --git a/dev/jquery.jtable.forms.js b/dev/jquery.jtable.forms.js
index b497a7e..0ef0c96 100644
--- a/dev/jquery.jtable.forms.js
+++ b/dev/jquery.jtable.forms.js
@@ -129,7 +129,7 @@
/* Creates a standart textbox for a field.
*************************************************************************/
_createTextInputForField: function (field, fieldName, value) {
- var $input = $('<input class="' + field.inputClass + '" id="Edit-' + fieldName + '" type="text" name="' + fieldName + '"></input>');
+ var $input = $('<input class="' + field.inputClass + '" placeholder="' + field.placeholder + '" id="Edit-' + fieldName + '" type="text" name="' + fieldName + '"></input>');
if (value != undefined) {
$input.val(value);
}
@@ -142,7 +142,7 @@
/* Creates a password input for a field.
*************************************************************************/
_createPasswordInputForField: function (field, fieldName, value) {
- var $input = $('<input class="' + field.inputClass + '" id="Edit-' + fieldName + '" type="password" name="' + fieldName + '"></input>');
+ var $input = $('<input class="' + field.inputClass + '" placeholder="' + field.placeholder + '" id="Edit-' + fieldName + '" type="password" name="' + fieldName + '"></input>');
if (value != undefined) {
$input.val(value);
}