Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add multi columns form option for Create dialog and Edit Dialog #2231

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
165dab9
Add option formDialogColumns
birddevelper Feb 15, 2020
9696a51
add createFormColumns option
birddevelper Feb 15, 2020
b003233
add createFormColumns option
birddevelper Feb 15, 2020
42b96db
Add multi column form style
birddevelper Feb 15, 2020
1b59242
Add multi columns form style
birddevelper Feb 15, 2020
ef86d65
add multi column form style
birddevelper Feb 15, 2020
4f9fe18
add multi column form style
birddevelper Feb 15, 2020
6300d4f
add multi columns form style
birddevelper Feb 15, 2020
f227951
add multi columns form style
birddevelper Feb 15, 2020
340af52
add multi column form style
birddevelper Feb 15, 2020
2065607
Add additional fields to row delete request POST data
birddevelper Mar 28, 2021
45faf56
Add additional fields to row delete request POST data
birddevelper Mar 28, 2021
b22eaa1
Add additional fields to row delete request POST data
birddevelper Mar 28, 2021
75d9f9a
new features list added
birddevelper Oct 9, 2021
c688d2d
Update README.md
birddevelper Oct 9, 2021
325bc49
Record preview feature added
birddevelper Nov 9, 2021
6a9f17a
Record preview file added to build text
birddevelper Nov 9, 2021
4a95e37
Record Preview feature added
birddevelper Nov 9, 2021
d6e7ccb
record preview form style
birddevelper Nov 9, 2021
1eb2a92
report.png path corrected
birddevelper Nov 9, 2021
95f9f17
preview icon added
birddevelper Nov 9, 2021
dd75434
preview style added
birddevelper Nov 9, 2021
ce0c168
preview icon added
birddevelper Nov 9, 2021
89c75af
preview style added
birddevelper Nov 9, 2021
242a3cf
preview style added
birddevelper Nov 9, 2021
7ffc66d
preview style added
birddevelper Nov 9, 2021
966108d
preview style added
birddevelper Nov 9, 2021
a58a0e0
preview style added
birddevelper Nov 9, 2021
6c00fe1
preview icon added to metro
birddevelper Nov 9, 2021
4bcc702
preview style added to metro blue
birddevelper Nov 9, 2021
627d9d5
preview style added to metro brown
birddevelper Nov 9, 2021
0cd9e7a
preview style added to metro crismon
birddevelper Nov 9, 2021
67f95c4
Update README.md
birddevelper Nov 9, 2021
efc8789
Update README.md
birddevelper Nov 9, 2021
663d430
Update README.md
birddevelper Nov 9, 2021
c93c114
Update README.md
birddevelper Nov 9, 2021
1876c11
Update jtable.css
birddevelper Nov 10, 2021
1ee4cbf
Update jtable.css
birddevelper Nov 10, 2021
79d61d2
Update jtable.css
birddevelper Nov 10, 2021
e158fa3
Update jtable.css
birddevelper Nov 10, 2021
4de62eb
Update jtable.css
birddevelper Nov 10, 2021
77679df
Update README.md
birddevelper Nov 10, 2021
2d57345
Update README.md
birddevelper Nov 14, 2021
ae849bb
Update README.md
birddevelper Nov 14, 2021
9e21815
Update README.md
birddevelper Nov 14, 2021
cabff18
Update README.md
birddevelper Nov 14, 2021
421697c
Update README.md
birddevelper Nov 14, 2021
eea5fe7
Update README.md
birddevelper Nov 14, 2021
5a84c9f
Update README.md
birddevelper Nov 14, 2021
ddecd6c
Send field to server if field delete option is explicitly set to true
birddevelper Nov 14, 2021
83e7be6
Update jTable.jquery.json
birddevelper Nov 15, 2021
25d83a9
Delete jquery.jtable.js
birddevelper Nov 15, 2021
f41c786
version with new features included
birddevelper Nov 15, 2021
69de450
Update README.md
birddevelper Nov 18, 2021
de50119
Update README.md
birddevelper Nov 18, 2021
8071f77
Update README.md
birddevelper Nov 18, 2021
2c78092
Update README.md
birddevelper Nov 18, 2021
4fa953f
Update README.md
birddevelper Nov 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 60 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,68 @@
What is jTable
What is msjTable
======

http://www.jtable.org


[![A screenshot of jTable](https://raw.githubusercontent.com/hikalkan/jtable/master/screenshot.png)](http://jtable.org/)

jTable is a jQuery plugin used to create AJAX based CRUD tables without coding HTML or Javascript. It has several features including:

* Automatically creates HTML table and loads records from server using AJAX.
* Creates 'create new record' jQueryUI dialog form. When user creates a record, it sends data to server using AJAX and adds the same record to the table in the page.
* Creates 'edit record' jQueryUI dialog form. When user edits a record, it updates server using AJAX and updates all cells on the table in the page.
* Allow user to 'delete a record' by jQueryUI dialog based confirmation. When user deletes a record, it deletes the record from server using AJAX and deletes the record from the table in the page.
* Shows animations for create/delete/edit operations on the table.
* Supports server side paging using AJAX.
* Supports server side sorting using AJAX.
* Supports master/child tables.
* Allows user to select rows.
* Allows user to resize columns.
* Allows user to show/hide columns.
* Exposes some events to enable validation with forms.
* It can be localized easily.
* All styling of table and forms are defined in a CSS file, so you can easily change style of everything to use plugin in your pages. CSS file is well defined and commented.
* It comes with pre-defined color themes.
* It is not depended on any server side technology.
* It is platform independed and works on all common browsers.
#### msjTable is a jQuery plugin forked from jTable, to create AJAX based CRUD tables without coding HTML or Javascript.

#### Additional features of msjTable :

* Record Preview feature :
```javascript
$("#myjtable").jtable({
...,
recordPreview : true, // setting recordPreview to true, a view icon will appeare beside edit icon in each row
...,
fields : {
...,
first_name : {
title : 'First name',
edit : true,
create : true,
preview : true, // specify which field you want to be shown in preview dialog
type : 'text'
},
...
});

```

* Multi columns form for Create, Edit and Preview dialogs.
```javascript
$("#myjtable").jtable({
...,
createFormColumns : 2, // set the number of columns in new record dialog
editFormColumns : 2, // set the number of columns in edit record dialog
viewFormColumns : 2, // set the number of columns in record preview dialog
...

});
```

* You can send any required fields to row-delete-request as POST data (jTable only sends single key field)
```javascript
$("#myjtable").jtable({
...,
fields : {
...,
first_name : {
title : 'First name',
edit : true,
create : true,
delete : true, // setting delete option of field to true, sends this field beside key field as parameters to delete request.
type : 'text'
},
...
});

```




Read More about additional features and its usage [here](https://m-shaeri.ir/blog/jquery-jtable-awesome-full-featured-plugin-for-crud-table/)

Notes
======
Expand Down
3 changes: 2 additions & 1 deletion dev/jquery.jtable.build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ add jquery.jtable.utils.js
add jquery.jtable.forms.js
add jquery.jtable.creation.js
add jquery.jtable.editing.js
add jquery.jtable.preview.js
add jquery.jtable.deletion.js
add jquery.jtable.selecting.js
add jquery.jtable.paging.js
add jquery.jtable.sorting.js
add jquery.jtable.dynamiccolumns.js
add jquery.jtable.masterchild.js
add jquery.jtable.masterchild.js
17 changes: 13 additions & 4 deletions dev/jquery.jtable.creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@

//Create add new record form
var $addRecordForm = $('<form id="jtable-create-form" class="jtable-dialog-form jtable-create-form"></form>');

var ColumnCount=self.options.createFormColumns ? self.options.createFormColumns : 1;
var CurrentColumnCount=0;
var $CreateFormTable = $('<table class="jtable-input-field-container-grid"/>').appendTo($addRecordForm);
var $RowContainer = $('<tr class="jtable-input-field-container-row" />').appendTo($CreateFormTable);
//Create input elements
for (var i = 0; i < self._fieldList.length; i++) {

Expand All @@ -247,10 +250,16 @@
continue;
}

//Create a container div for this input field and add to form
var $fieldContainer = $('<div />')
//Create a container table cell for this input field and add to form
var $fieldContainer = $('<td />')
.addClass('jtable-input-field-container')
.appendTo($addRecordForm);
.appendTo($RowContainer);

CurrentColumnCount++;
if(CurrentColumnCount==ColumnCount) {
$RowContainer=$('<tr class="jtable-input-field-container-row" />').appendTo($CreateFormTable);
CurrentColumnCount=0;
}

//Create a label for input
$fieldContainer.append(self._createInputLabelForRecordField(fieldName));
Expand Down
19 changes: 19 additions & 0 deletions dev/jquery.jtable.deletion.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,25 @@
var postData = {};
postData[self._keyField] = self._getKeyValueOfRecord($row.data('record'));

//Add additional field to delete request POST
for (var i = 0; i < this._fieldList.length; i++) {
var fieldName = this._fieldList[i];
var field = this.options.fields[fieldName];

//Do not send this field to server if field delete option is not explicitly set to true
if (!field.delete) {
continue;
}

//Key field is already added to postData
if (self._keyField == fieldName) {
continue;
}

//Add field to postData to be sent to server
postData[fieldName] = $row.data('record')[fieldName];
}

//deleteAction may be a function, check if it is
if (!url && $.isFunction(self.options.actions.deleteAction)) {

Expand Down
15 changes: 13 additions & 2 deletions dev/jquery.jtable.editing.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@

//Create edit form
var $editForm = $('<form id="jtable-edit-form" class="jtable-dialog-form jtable-edit-form"></form>');

var ColumnCount=self.options.editFormColumns ? self.options.editFormColumns : 1;
var CurrentColumnCount=0;
var $EditFormTable = $('<table class="jtable-input-field-container-grid"/>').appendTo($editForm);
var $RowContainer = $('<tr class="jtable-input-field-container-row" />').appendTo($EditFormTable);
//Create input fields
for (var i = 0; i < self._fieldList.length; i++) {

Expand Down Expand Up @@ -289,7 +292,15 @@
}

//Create a container div for this input field and add to form
var $fieldContainer = $('<div class="jtable-input-field-container"></div>').appendTo($editForm);
var $fieldContainer = $('<td />')
.addClass('jtable-input-field-container')
.appendTo($RowContainer);

CurrentColumnCount++;
if(CurrentColumnCount==ColumnCount) {
$RowContainer=$('<tr class="jtable-input-field-container-row" />').appendTo($EditFormTable);
CurrentColumnCount=0;
}

//Create a label for input
$fieldContainer.append(self._createInputLabelForRecordField(fieldName));
Expand Down
Loading