kosmas58-compass-jquery-plugin 0.2.0 → 0.2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/jquery/version.rb +1 -1
- data/templates/jqgrid/i18n/jqgrid/locale-de.js +1 -1
- data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +1 -1
- data/templates/jqgrid/i18n/jqgrid/locale-nl.js +145 -0
- data/templates/jqgrid/i18n/jqgrid/locale-nl.min.js +1 -0
- data/templates/jqgrid/i18n/jqgrid/locale-tr.js +23 -23
- data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +1 -1
- data/templates/jqgrid/jquery.jqGrid.js +479 -293
- data/templates/jqgrid/jquery.jqGrid.min.js +1 -1
- data/templates/jqgrid/jquery.ui/jqGrid.sass +45 -4
- data/templates/jqgrid/manifest.rb +2 -0
- metadata +5 -2
data/lib/jquery/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(a){a.jgrid={defaults:{recordtext:"Zeige {0} - {1} von {2}",emptyrecords:"Keine Datensätze vorhanden",loadtext:"Lädt...",pgtext:"Seite {0} von {1}"},search:{caption:"Suche...",Find:"Finden",Reset:"Zurücksetzen",odata:["gleich","ungleich","kleiner","kleiner gleich","größer","größer gleich","beginnt mit","beginnt nicht mit","ist in","ist nicht in","endet mit","endet nicht mit","enthält","enthält nicht"],groupOps:[{op:"AND",text:"alle"},{op:"OR",text:"mindestens eins"}],matchText:" match",rulesText:" rules"},edit:{addCaption:"Datensatz hinzufügen",editCaption:"Datensatz bearbeiten",bSubmit:"Speichern",bCancel:"Abbrechen",bClose:"Schließen",saveData:"Daten wurden geändert! Änderungen speichern?",bYes:"ja",bNo:"nein",bExit:"abbrechen",msg:{required:"Feld ist erforderlich",number:"Bitte geben Sie eine Zahl ein",minValue:"Wert muss größer oder gleich sein, als ",maxValue:"Wert muss kleiner oder gleich sein, als ",email:"ist keine valide E-Mail Adresse",integer:"Bitte geben Sie eine Ganzzahl ein",date:"Bitte geben Sie ein gültiges Datum ein",url:"ist keine gültige URL. Prefix muss eingegeben werden ('http://' oder 'https://')"}},view:{caption:"Datensatz anschauen",bClose:"Schließen"},del:{caption:"Löschen",msg:"Ausgewählte Datensätze löschen?",bSubmit:"Löschen",bCancel:"Abbrechen"},nav:{edittext:" ",edittitle:"Ausgewählten Zeile editieren",addtext:" ",addtitle:"Neuen Zeile einfügen",deltext:" ",deltitle:"Ausgewählte Zeile löschen",searchtext:" ",searchtitle:"Datensatz finden",refreshtext:"",refreshtitle:"Tabelle neu laden",alertcap:"Warnung",alerttext:"Bitte Zeile auswählen",viewtext:"",viewtitle:"
|
1
|
+
(function(a){a.jgrid={defaults:{recordtext:"Zeige {0} - {1} von {2}",emptyrecords:"Keine Datensätze vorhanden",loadtext:"Lädt...",pgtext:"Seite {0} von {1}"},search:{caption:"Suche...",Find:"Finden",Reset:"Zurücksetzen",odata:["gleich","ungleich","kleiner","kleiner gleich","größer","größer gleich","beginnt mit","beginnt nicht mit","ist in","ist nicht in","endet mit","endet nicht mit","enthält","enthält nicht"],groupOps:[{op:"AND",text:"alle"},{op:"OR",text:"mindestens eins"}],matchText:" match",rulesText:" rules"},edit:{addCaption:"Datensatz hinzufügen",editCaption:"Datensatz bearbeiten",bSubmit:"Speichern",bCancel:"Abbrechen",bClose:"Schließen",saveData:"Daten wurden geändert! Änderungen speichern?",bYes:"ja",bNo:"nein",bExit:"abbrechen",msg:{required:"Feld ist erforderlich",number:"Bitte geben Sie eine Zahl ein",minValue:"Wert muss größer oder gleich sein, als ",maxValue:"Wert muss kleiner oder gleich sein, als ",email:"ist keine valide E-Mail Adresse",integer:"Bitte geben Sie eine Ganzzahl ein",date:"Bitte geben Sie ein gültiges Datum ein",url:"ist keine gültige URL. Prefix muss eingegeben werden ('http://' oder 'https://')"}},view:{caption:"Datensatz anschauen",bClose:"Schließen"},del:{caption:"Löschen",msg:"Ausgewählte Datensätze löschen?",bSubmit:"Löschen",bCancel:"Abbrechen"},nav:{edittext:" ",edittitle:"Ausgewählten Zeile editieren",addtext:" ",addtitle:"Neuen Zeile einfügen",deltext:" ",deltitle:"Ausgewählte Zeile löschen",searchtext:" ",searchtitle:"Datensatz finden",refreshtext:"",refreshtitle:"Tabelle neu laden",alertcap:"Warnung",alerttext:"Bitte Zeile auswählen",viewtext:"",viewtitle:"Ausgewählte Zeile anzeigen"},col:{caption:"Spalten anzeigen/verbergen",bSubmit:"Speichern",bCancel:"Abbrechen"},errors:{errcap:"Fehler",nourl:"Keine URL angegeben",norecords:"Keine Datensätze zum verarbeiten",model:"colNames und colModel sind unterschiedlich lang!"},formatter:{integer:{thousandsSeparator:" ",defaultValue:"0"},number:{decimalSeparator:",",thousandsSeparator:".",decimalPlaces:2,defaultValue:"0,00"},currency:{decimalSeparator:",",thousandsSeparator:".",decimalPlaces:2,prefix:"",suffix:" €",defaultValue:"0,00"},date:{dayNames:["So","Mo","Di","Mi","Do","Fr","Sa","Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],monthNames:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez","Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],AmPm:["am","pm","AM","PM"],S:function(b){return b<11||b>13?["st","nd","rd","th"][Math.min((b-1)%10,3)]:"th"},srcformat:"Y-m-d",newformat:"d/m/Y",masks:{ISO8601Long:"d.m.Y H:i:s",ISO8601Short:"d.m.Y",ShortDate:"j.n.Y",LongDate:"l, d. F Y",FullDateTime:"l, d. F Y G:i:s",MonthDay:"d. F",ShortTime:"G:i",LongTime:"G:i:s",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F Y"},reformatAfterEdit:false},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:true},idName:"id"}}})(jQuery);
|
@@ -0,0 +1,145 @@
|
|
1
|
+
(function(a) {
|
2
|
+
a.jgrid =
|
3
|
+
{
|
4
|
+
defaults:
|
5
|
+
{
|
6
|
+
recordtext: "regels {0} - {1} van {2}",
|
7
|
+
emptyrecords: "Geen data gevonden.",
|
8
|
+
loadtext: "laden...",
|
9
|
+
pgtext: "pagina {0} van {1}"
|
10
|
+
},
|
11
|
+
search:
|
12
|
+
{
|
13
|
+
caption: "Zoeken...",
|
14
|
+
Find: "Zoek",
|
15
|
+
Reset: "Herstellen",
|
16
|
+
odata: ["gelijk aan", "niet gelijk aan", "kleiner dan", "kleiner dan of gelijk aan", "groter dan", "groter dan of gelijk aan", "begint met", "begint niet met", "is in", "is niet in", "eindigd met", "eindigd niet met", "bevat", "bevat niet"],
|
17
|
+
groupOps: [{ op: "AND", text: "alle" }, { op: "OR", text: "een van de"}],
|
18
|
+
matchText: " match",
|
19
|
+
rulesText: " regels"
|
20
|
+
},
|
21
|
+
edit:
|
22
|
+
{
|
23
|
+
addCaption: "Nieuw",
|
24
|
+
editCaption: "Bewerken",
|
25
|
+
bSubmit: "Opslaan",
|
26
|
+
bCancel: "Annuleren",
|
27
|
+
bClose: "Sluiten",
|
28
|
+
saveData: "Er is data aangepast! Wijzigingen opslaan?",
|
29
|
+
bYes: "Ja",
|
30
|
+
bNo: "Nee",
|
31
|
+
bExit: "Sluiten",
|
32
|
+
msg:
|
33
|
+
{
|
34
|
+
required: "Veld is verplicht",
|
35
|
+
number: "Voer a.u.b. geldig nummer in",
|
36
|
+
minValue: "Waarde moet groter of gelijk zijn aan ",
|
37
|
+
maxValue: "Waarde moet kleiner of gelijks zijn aan",
|
38
|
+
email: "is geen geldig e-mailadres",
|
39
|
+
integer: "Voer a.u.b. een geldig getal in",
|
40
|
+
date: "Voer a.u.b. een geldige waarde in",
|
41
|
+
url: "is geen geldige URL. Prefix is verplicht ('http://' or 'https://')"
|
42
|
+
}
|
43
|
+
},
|
44
|
+
view:
|
45
|
+
{
|
46
|
+
caption: "Tonen",
|
47
|
+
bClose: "Sluiten"
|
48
|
+
},
|
49
|
+
del:
|
50
|
+
{
|
51
|
+
caption: "Verwijderen",
|
52
|
+
msg: "Verwijder geselecteerde regel(s)?",
|
53
|
+
bSubmit: "Verwijderen",
|
54
|
+
bCancel: "Annuleren"
|
55
|
+
},
|
56
|
+
nav:
|
57
|
+
{
|
58
|
+
edittext: "",
|
59
|
+
edittitle: "Bewerken",
|
60
|
+
addtext: "",
|
61
|
+
addtitle: "Nieuw",
|
62
|
+
deltext: "",
|
63
|
+
deltitle: "Verwijderen",
|
64
|
+
searchtext: "",
|
65
|
+
searchtitle: "Zoeken",
|
66
|
+
refreshtext: "",
|
67
|
+
refreshtitle: "Vernieuwen",
|
68
|
+
alertcap: "Waarschuwing",
|
69
|
+
alerttext: "Selecteer a.u.b. een regel",
|
70
|
+
viewtext: "",
|
71
|
+
viewtitle: "Openen"
|
72
|
+
},
|
73
|
+
col:
|
74
|
+
{
|
75
|
+
caption: "Tonen/verbergen kolommen",
|
76
|
+
bSubmit: "OK",
|
77
|
+
bCancel: "Annuleren"
|
78
|
+
},
|
79
|
+
errors:
|
80
|
+
{
|
81
|
+
errcap: "Fout",
|
82
|
+
nourl: "Er is geen URL gedefinieerd",
|
83
|
+
norecords: "Geen data om te verwerken",
|
84
|
+
model: "Lengte van 'colNames' is niet gelijk aan 'colModel'!"
|
85
|
+
},
|
86
|
+
formatter:
|
87
|
+
{
|
88
|
+
integer:
|
89
|
+
{
|
90
|
+
thousandsSeparator: ".",
|
91
|
+
defaultValue: "0"
|
92
|
+
},
|
93
|
+
number:
|
94
|
+
{
|
95
|
+
decimalSeparator: ",",
|
96
|
+
thousandsSeparator: ".",
|
97
|
+
decimalPlaces: 2,
|
98
|
+
defaultValue: "0.00"
|
99
|
+
},
|
100
|
+
currency:
|
101
|
+
{
|
102
|
+
decimalSeparator: ",",
|
103
|
+
thousandsSeparator: ".",
|
104
|
+
decimalPlaces: 2,
|
105
|
+
prefix: "EUR ",
|
106
|
+
suffix: "",
|
107
|
+
defaultValue: "0.00"
|
108
|
+
},
|
109
|
+
date:
|
110
|
+
{
|
111
|
+
dayNames: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
|
112
|
+
monthNames: ["Jan", "Feb", "Maa", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "October", "November", "December"],
|
113
|
+
AmPm: ["am", "pm", "AM", "PM"],
|
114
|
+
S: function(b) {
|
115
|
+
return b < 11 || b > 13 ? ["st", "nd", "rd", "th"][Math.min((b - 1) % 10, 3)] : "th"
|
116
|
+
},
|
117
|
+
srcformat: "Y-m-d",
|
118
|
+
newformat: "d/m/Y",
|
119
|
+
masks:
|
120
|
+
{
|
121
|
+
ISO8601Long: "Y-m-d H:i:s",
|
122
|
+
ISO8601Short: "Y-m-d",
|
123
|
+
ShortDate: "n/j/Y",
|
124
|
+
LongDate: "l, F d, Y",
|
125
|
+
FullDateTime: "l d F Y G:i:s",
|
126
|
+
MonthDay: "d F",
|
127
|
+
ShortTime: "G:i",
|
128
|
+
LongTime: "G:i:s",
|
129
|
+
SortableDateTime: "Y-m-d\\TH:i:s",
|
130
|
+
UniversalSortableDateTime: "Y-m-d H:i:sO",
|
131
|
+
YearMonth: "F, Y"
|
132
|
+
},
|
133
|
+
reformatAfterEdit: false
|
134
|
+
},
|
135
|
+
baseLinkUrl: "",
|
136
|
+
showAction: "",
|
137
|
+
target: "",
|
138
|
+
checkbox:
|
139
|
+
{
|
140
|
+
disabled: true
|
141
|
+
},
|
142
|
+
idName: "id"
|
143
|
+
}
|
144
|
+
}
|
145
|
+
})(jQuery);
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(b){b.jgrid={defaults:{recordtext:"regels {0} - {1} van {2}",emptyrecords:"Geen data gevonden.",loadtext:"laden...",pgtext:"pagina {0} van {1}"},search:{caption:"Zoeken...",Find:"Zoek",Reset:"Herstellen",odata:["gelijk aan","niet gelijk aan","kleiner dan","kleiner dan of gelijk aan","groter dan","groter dan of gelijk aan","begint met","begint niet met","is in","is niet in","eindigd met","eindigd niet met","bevat","bevat niet"],groupOps:[{op:"AND",text:"alle"},{op:"OR",text:"een van de"}],matchText:" match",rulesText:" regels"},edit:{addCaption:"Nieuw",editCaption:"Bewerken",bSubmit:"Opslaan",bCancel:"Annuleren",bClose:"Sluiten",saveData:"Er is data aangepast! Wijzigingen opslaan?",bYes:"Ja",bNo:"Nee",bExit:"Sluiten",msg:{required:"Veld is verplicht",number:"Voer a.u.b. geldig nummer in",minValue:"Waarde moet groter of gelijk zijn aan ",maxValue:"Waarde moet kleiner of gelijks zijn aan",email:"is geen geldig e-mailadres",integer:"Voer a.u.b. een geldig getal in",date:"Voer a.u.b. een geldige waarde in",url:"is geen geldige URL. Prefix is verplicht ('http://' or 'https://')"}},view:{caption:"Tonen",bClose:"Sluiten"},del:{caption:"Verwijderen",msg:"Verwijder geselecteerde regel(s)?",bSubmit:"Verwijderen",bCancel:"Annuleren"},nav:{edittext:"",edittitle:"Bewerken",addtext:"",addtitle:"Nieuw",deltext:"",deltitle:"Verwijderen",searchtext:"",searchtitle:"Zoeken",refreshtext:"",refreshtitle:"Vernieuwen",alertcap:"Waarschuwing",alerttext:"Selecteer a.u.b. een regel",viewtext:"",viewtitle:"Openen"},col:{caption:"Tonen/verbergen kolommen",bSubmit:"OK",bCancel:"Annuleren"},errors:{errcap:"Fout",nourl:"Er is geen URL gedefinieerd",norecords:"Geen data om te verwerken",model:"Lengte van 'colNames' is niet gelijk aan 'colModel'!"},formatter:{integer:{thousandsSeparator:".",defaultValue:"0"},number:{decimalSeparator:",",thousandsSeparator:".",decimalPlaces:2,defaultValue:"0.00"},currency:{decimalSeparator:",",thousandsSeparator:".",decimalPlaces:2,prefix:"EUR ",suffix:"",defaultValue:"0.00"},date:{dayNames:["Zo","Ma","Di","Wo","Do","Vr","Za","Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],monthNames:["Jan","Feb","Maa","Apr","Mei","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","October","November","December"],AmPm:["am","pm","AM","PM"],S:function(a){return a<11||a>13?["st","nd","rd","th"][Math.min((a-1)%10,3)]:"th"},srcformat:"Y-m-d",newformat:"d/m/Y",masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l d F Y G:i:s",MonthDay:"d F",ShortTime:"G:i",LongTime:"G:i:s",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F, Y"},reformatAfterEdit:false},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:true},idName:"id"}}})(jQuery);
|
@@ -1,27 +1,27 @@
|
|
1
1
|
;(function($){
|
2
2
|
/**
|
3
3
|
* jqGrid Turkish Translation
|
4
|
-
*
|
5
|
-
* http://
|
4
|
+
* Erhan Gündoğan (erhan@trposta.net)
|
5
|
+
* http://blog.zakkum.com
|
6
6
|
* Dual licensed under the MIT and GPL licenses:
|
7
7
|
* http://www.opensource.org/licenses/mit-license.php
|
8
8
|
* http://www.gnu.org/licenses/gpl.html
|
9
9
|
**/
|
10
10
|
$.jgrid = {
|
11
11
|
defaults : {
|
12
|
-
recordtext: "
|
13
|
-
emptyrecords: "
|
12
|
+
recordtext: "{0}-{1} listeleniyor. Toplam:{2}",
|
13
|
+
emptyrecords: "Kayıt bulunamadı",
|
14
14
|
loadtext: "Yükleniyor...",
|
15
|
-
pgtext : "
|
15
|
+
pgtext : "{0}/{1}. Sayfa"
|
16
16
|
},
|
17
17
|
search : {
|
18
18
|
caption: "Arama...",
|
19
19
|
Find: "Bul",
|
20
|
-
Reset: "Temizle",
|
21
|
-
odata : ['
|
22
|
-
groupOps: [ { op: "
|
23
|
-
matchText: "
|
24
|
-
rulesText: "
|
20
|
+
Reset: "Temizle",
|
21
|
+
odata : ['eşit', 'eşit değil', 'daha az', 'daha az veya eşit', 'daha fazla', 'daha fazla veya eşit', 'ile başlayan', 'ile başlamayan', 'içinde', 'içinde değil', 'ile biten', 'ile bitmeyen', 'içeren', 'içermeyen'],
|
22
|
+
groupOps: [ { op: "VE", text: "tüm" }, { op: "VEYA", text: "herhangi" } ],
|
23
|
+
matchText: " uyan",
|
24
|
+
rulesText: " kurallar"
|
25
25
|
},
|
26
26
|
edit : {
|
27
27
|
addCaption: "Kayıt Ekle",
|
@@ -29,10 +29,10 @@ $.jgrid = {
|
|
29
29
|
bSubmit: "Gönder",
|
30
30
|
bCancel: "İptal",
|
31
31
|
bClose: "Kapat",
|
32
|
-
saveData: "
|
33
|
-
bYes : "
|
34
|
-
bNo : "
|
35
|
-
bExit : "
|
32
|
+
saveData: "Veriler değişti! Kayıt edilsin mi?",
|
33
|
+
bYes : "Evet",
|
34
|
+
bNo : "Hayıt",
|
35
|
+
bExit : "İptal",
|
36
36
|
msg: {
|
37
37
|
required:"Alan gerekli",
|
38
38
|
number:"Lütfen bir numara giriniz",
|
@@ -40,12 +40,12 @@ $.jgrid = {
|
|
40
40
|
maxValue:"girilen değer daha küçük ya da buna eşit olmalıdır",
|
41
41
|
email: "geçerli bir e-posta adresi değildir",
|
42
42
|
integer: "Lütfen bir tamsayı giriniz",
|
43
|
-
url: "
|
43
|
+
url: "Geçerli bir URL değil. ('http://' or 'https://') ön eki gerekli."
|
44
44
|
}
|
45
45
|
},
|
46
46
|
view : {
|
47
|
-
caption: "
|
48
|
-
bClose: "
|
47
|
+
caption: "Kayıt Görüntüle",
|
48
|
+
bClose: "Kapat"
|
49
49
|
},
|
50
50
|
del : {
|
51
51
|
caption: "Sil",
|
@@ -67,7 +67,7 @@ $.jgrid = {
|
|
67
67
|
alertcap: "Uyarı",
|
68
68
|
alerttext: "Lütfen bir satır seçiniz",
|
69
69
|
viewtext: "",
|
70
|
-
viewtitle: "
|
70
|
+
viewtitle: "Seçilen satırı görüntüle"
|
71
71
|
},
|
72
72
|
col : {
|
73
73
|
caption: "Sütunları göster/gizle",
|
@@ -78,7 +78,7 @@ $.jgrid = {
|
|
78
78
|
errcap : "Hata",
|
79
79
|
nourl : "Bir url yapılandırılmamış",
|
80
80
|
norecords: "İşlem yapılacak bir kayıt yok",
|
81
|
-
model : "
|
81
|
+
model : "colNames uzunluğu <> colModel!"
|
82
82
|
},
|
83
83
|
formatter : {
|
84
84
|
integer : {thousandsSeparator: " ", defaultValue: '0'},
|
@@ -86,12 +86,12 @@ $.jgrid = {
|
|
86
86
|
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
|
87
87
|
date : {
|
88
88
|
dayNames: [
|
89
|
-
"
|
90
|
-
"
|
89
|
+
"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts",
|
90
|
+
"Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"
|
91
91
|
],
|
92
92
|
monthNames: [
|
93
|
-
"
|
94
|
-
"
|
93
|
+
"Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara",
|
94
|
+
"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
|
95
95
|
],
|
96
96
|
AmPm : ["am","pm","AM","PM"],
|
97
97
|
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
|
@@ -1 +1 @@
|
|
1
|
-
(function(a){a.jgrid={defaults:{recordtext:"
|
1
|
+
(function(a){a.jgrid={defaults:{recordtext:"{0}-{1} listeleniyor. Toplam:{2}",emptyrecords:"Kayıt bulunamadı",loadtext:"Yükleniyor...",pgtext:"{0}/{1}. Sayfa"},search:{caption:"Arama...",Find:"Bul",Reset:"Temizle",odata:["eşit","eşit değil","daha az","daha az veya eşit","daha fazla","daha fazla veya eşit","ile başlayan","ile başlamayan","içinde","içinde değil","ile biten","ile bitmeyen","içeren","içermeyen"],groupOps:[{op:"VE",text:"tüm"},{op:"VEYA",text:"herhangi"}],matchText:" uyan",rulesText:" kurallar"},edit:{addCaption:"Kayıt Ekle",editCaption:"Kayıt Düzenle",bSubmit:"Gönder",bCancel:"İptal",bClose:"Kapat",saveData:"Veriler değişti! Kayıt edilsin mi?",bYes:"Evet",bNo:"Hayıt",bExit:"İptal",msg:{required:"Alan gerekli",number:"Lütfen bir numara giriniz",minValue:"girilen değer daha büyük ya da buna eşit olmalıdır",maxValue:"girilen değer daha küçük ya da buna eşit olmalıdır",email:"geçerli bir e-posta adresi değildir",integer:"Lütfen bir tamsayı giriniz",url:"Geçerli bir URL değil. ('http://' or 'https://') ön eki gerekli."}},view:{caption:"Kayıt Görüntüle",bClose:"Kapat"},del:{caption:"Sil",msg:"Seçilen kayıtlar silinsin mi?",bSubmit:"Sil",bCancel:"İptal"},nav:{edittext:" ",edittitle:"Seçili satırı düzenle",addtext:" ",addtitle:"Yeni satır ekle",deltext:" ",deltitle:"Seçili satırı sil",searchtext:" ",searchtitle:"Kayıtları bul",refreshtext:"",refreshtitle:"Tabloyu yenile",alertcap:"Uyarı",alerttext:"Lütfen bir satır seçiniz",viewtext:"",viewtitle:"Seçilen satırı görüntüle"},col:{caption:"Sütunları göster/gizle",bSubmit:"Gönder",bCancel:"İptal"},errors:{errcap:"Hata",nourl:"Bir url yapılandırılmamış",norecords:"İşlem yapılacak bir kayıt yok",model:"colNames uzunluğu <> colModel!"},formatter:{integer:{thousandsSeparator:" ",defaultValue:"0"},number:{decimalSeparator:".",thousandsSeparator:" ",decimalPlaces:2,defaultValue:"0.00"},currency:{decimalSeparator:".",thousandsSeparator:" ",decimalPlaces:2,prefix:"",suffix:"",defaultValue:"0.00"},date:{dayNames:["Paz","Pts","Sal","Çar","Per","Cum","Cts","Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],monthNames:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara","Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],AmPm:["am","pm","AM","PM"],S:function(b){return b<11||b>13?["st","nd","rd","th"][Math.min((b-1)%10,3)]:"th"},srcformat:"Y-m-d",newformat:"d/m/Y",masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y g:i:s A",MonthDay:"F d",ShortTime:"g:i A",LongTime:"g:i:s A",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F, Y"},reformatAfterEdit:false},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:true},idName:"id"}}})(jQuery);
|
@@ -1,26 +1,27 @@
|
|
1
1
|
;(function ($) {
|
2
2
|
/*
|
3
|
-
* jqGrid 3.5 - jQuery Grid
|
3
|
+
* jqGrid 3.5.2 - jQuery Grid
|
4
4
|
* Copyright (c) 2008, Tony Tomov, tony@trirand.com
|
5
5
|
* Dual licensed under the MIT and GPL licenses
|
6
6
|
* http://www.opensource.org/licenses/mit-license.php
|
7
7
|
* http://www.gnu.org/licenses/gpl.html
|
8
|
-
* Date: 2009-08-
|
8
|
+
* Date: 2009-08-14
|
9
9
|
*/
|
10
|
+
$.jgrid = $.jgrid || {};
|
10
11
|
$.extend($.jgrid,{
|
11
12
|
htmlDecode : function(value){
|
12
13
|
if(value==' ' || value==' ' || (value.length==1 && value.charCodeAt(0)==160)) { return "";}
|
13
14
|
return !value ? value : String(value).replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"');
|
14
15
|
},
|
15
16
|
htmlEncode : function (value){
|
16
|
-
|
17
|
+
return !value ? value : String(value).replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, """);
|
17
18
|
},
|
18
|
-
|
19
|
+
format : function(format){ //jqgformat
|
19
20
|
var args = $.makeArray(arguments).slice(1);
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
return format.replace(/\{(\d+)\}/g, function(m, i){
|
22
|
+
return args[i];
|
23
|
+
});
|
24
|
+
},
|
24
25
|
getAbsoluteIndex : function (t,rInd){
|
25
26
|
var cntnotv=0,cntv=0, cell, i;
|
26
27
|
if($.browser.version > 7 ) return rInd;
|
@@ -58,7 +59,10 @@ $.extend($.jgrid,{
|
|
58
59
|
with(window) {
|
59
60
|
return eval('('+js+')');
|
60
61
|
}
|
61
|
-
}
|
62
|
+
},
|
63
|
+
empty : function () {
|
64
|
+
while ( this.firstChild ) this.removeChild( this.firstChild );
|
65
|
+
}
|
62
66
|
});
|
63
67
|
$.fn.jqGrid = function( p ) {
|
64
68
|
p = $.extend(true,{
|
@@ -120,7 +124,7 @@ $.fn.jqGrid = function( p ) {
|
|
120
124
|
treeANode : -1,
|
121
125
|
ExpandColumn: null,
|
122
126
|
tree_root_level : 0,
|
123
|
-
prmNames: {page:"page",rows:"rows", sort: "sidx",order: "sord"},
|
127
|
+
prmNames: {page:"page",rows:"rows", sort: "sidx",order: "sord", search:"_search", nd:"nd"},
|
124
128
|
forceFit : false,
|
125
129
|
gridstate : "visible",
|
126
130
|
cellEdit: false,
|
@@ -140,14 +144,15 @@ $.fn.jqGrid = function( p ) {
|
|
140
144
|
gridview: false,
|
141
145
|
rownumWidth: 25,
|
142
146
|
rownumbers : false,
|
143
|
-
|
144
|
-
|
147
|
+
pagerpos: 'center',
|
148
|
+
recordpos: 'right',
|
145
149
|
footerrow : false,
|
146
150
|
userDataOnFooter : false,
|
147
151
|
hoverrows : true,
|
148
152
|
altclass : 'ui-priority-secondary',
|
149
153
|
viewsortcols : [false,'vertical',true],
|
150
|
-
resizeclass : ''
|
154
|
+
resizeclass : '',
|
155
|
+
autoencode : false
|
151
156
|
}, $.jgrid.defaults, p || {});
|
152
157
|
var grid={
|
153
158
|
headers:[],
|
@@ -247,7 +252,7 @@ $.fn.jqGrid = function( p ) {
|
|
247
252
|
alert($.jgrid.errors.model);
|
248
253
|
return;
|
249
254
|
}
|
250
|
-
var gv = $("<div class='ui-jqgrid-view'
|
255
|
+
var gv = $("<div class='ui-jqgrid-view'></div>"), ii,
|
251
256
|
isMSIE = $.browser.msie ? true:false,
|
252
257
|
isSafari = $.browser.safari ? true : false;
|
253
258
|
|
@@ -312,7 +317,7 @@ $.fn.jqGrid = function( p ) {
|
|
312
317
|
return v;
|
313
318
|
},
|
314
319
|
cellVal = function (val) {
|
315
|
-
return val === undefined || val === null || val === "" ? " " : val+"";
|
320
|
+
return val === undefined || val === null || val === "" ? " " : ts.p.autoencode ? $.jgrid.htmlEncode(val+"") : val+"";
|
316
321
|
},
|
317
322
|
addMulti = function(rowid,pos,irow){
|
318
323
|
var v = "<input type=\"checkbox\""+" id=\"jqg_"+rowid+"\" class=\"cbox\" name=\"jqg_"+rowid+"\"/>",
|
@@ -336,10 +341,15 @@ $.fn.jqGrid = function( p ) {
|
|
336
341
|
return f;
|
337
342
|
},
|
338
343
|
addXmlData = function (xml,t, rcnt) {
|
344
|
+
var startReq = new Date();
|
339
345
|
ts.p.reccount = 0;
|
340
346
|
if($.isXMLDoc(xml)) {
|
341
347
|
if(ts.p.treeANode===-1 && ts.p.scroll===false) {
|
342
|
-
$("tbody", t)
|
348
|
+
var tBody = $("tbody:first", t);
|
349
|
+
if(!ts.p.gridview) $("*",tBody).children().unbind();
|
350
|
+
if(isMSIE) $.jgrid.empty.apply(tBody[0]);
|
351
|
+
else tBody[0].innerHTML="";
|
352
|
+
tBody = null; rcnt=0;
|
343
353
|
} else { rcnt = rcnt > 0 ? rcnt :0; }
|
344
354
|
} else { return; }
|
345
355
|
var i,fpos,ir=0,v,row,gi=0,si=0,ni=0,idn, getId,f=[],rd ={}, rl= ts.rows.length, xmlr,rid, rowData=[],ari=0, cn=(ts.p.altRows === true) ? ts.p.altclass:'',cn1;
|
@@ -411,12 +421,13 @@ $.fn.jqGrid = function( p ) {
|
|
411
421
|
rd={};
|
412
422
|
ir++;
|
413
423
|
j++;
|
414
|
-
if(ir
|
424
|
+
if( rn !=-1 && ir>rn) {break;}
|
415
425
|
}
|
416
426
|
}
|
417
427
|
if(ts.p.gridview === true) {
|
418
428
|
$("table:first",t).append(rowData.join(''));
|
419
429
|
}
|
430
|
+
ts.p.totaltime = new Date() - startReq;
|
420
431
|
if(ir>0) {ts.grid.cols = ts.rows[0].cells;if(ts.p.records===0)ts.p.records=gl;}
|
421
432
|
rowData =null;
|
422
433
|
if(!ts.p.treeGrid && !ts.p.scroll) {ts.grid.bDiv.scrollTop = 0; ts.p.reccount=ir;}
|
@@ -425,10 +436,15 @@ $.fn.jqGrid = function( p ) {
|
|
425
436
|
updatepager(false);
|
426
437
|
},
|
427
438
|
addJSONData = function(data,t, rcnt) {
|
439
|
+
var startReq = new Date();
|
428
440
|
ts.p.reccount = 0;
|
429
441
|
if(data) {
|
430
442
|
if(ts.p.treeANode === -1 && ts.p.scroll===false) {
|
431
|
-
$("tbody", t)
|
443
|
+
var tBody = $("tbody:first", t);
|
444
|
+
if(!ts.p.gridview) $("*",tBody).children().unbind();
|
445
|
+
if(isMSIE) $.jgrid.empty.apply(tBody[0]);
|
446
|
+
else tBody[0].innerHTML="";
|
447
|
+
tBody = null; rcnt=0;
|
432
448
|
} else { rcnt = rcnt > 0 ? rcnt :0; }
|
433
449
|
} else { return; }
|
434
450
|
var ir=0,v,i,j,row,f=[],cur,gi=0,si=0,ni=0,len,drows,idn,rd={}, fpos,rl = ts.rows.length,idr,rowData=[],ari=0,cn=(ts.p.altRows === true) ? ts.p.altclass:'',cn1;
|
@@ -511,11 +527,12 @@ $.fn.jqGrid = function( p ) {
|
|
511
527
|
rd={};
|
512
528
|
ir++;
|
513
529
|
i++;
|
514
|
-
if(ir>rn) break;
|
530
|
+
if(rn !=-1 && ir>rn) break;
|
515
531
|
}
|
516
532
|
if(ts.p.gridview === true ) {
|
517
533
|
$("table:first",t).append(rowData.join(''));
|
518
534
|
}
|
535
|
+
ts.p.totaltime = new Date() - startReq;
|
519
536
|
if(ir>0) {ts.grid.cols = ts.rows[0].cells;if(ts.p.records===0)ts.p.records=len;}
|
520
537
|
}
|
521
538
|
if(!ts.p.treeGrid && !ts.p.scroll) {ts.grid.bDiv.scrollTop = 0;}
|
@@ -570,25 +587,27 @@ $.fn.jqGrid = function( p ) {
|
|
570
587
|
if($.isFunction(ts.p.gridComplete)) {ts.p.gridComplete();}
|
571
588
|
},
|
572
589
|
populate = function () {
|
573
|
-
if(!grid.hDiv.loading) {
|
574
|
-
var prm = {
|
575
|
-
prm[
|
576
|
-
prm[
|
590
|
+
if(!ts.grid.hDiv.loading) {
|
591
|
+
var prm = {}, dt, dstr, pN=ts.p.prmNames;;
|
592
|
+
if(pN.search !== null) prm[pN.search] = ts.p.search; if(pN.nd != null) prm[pN.nd] = new Date().getTime();
|
593
|
+
if(pN.rows !== null) prm[pN.rows]= ts.p.rowNum; if(pN.page !== null) prm[pN.page]= ts.p.page;
|
594
|
+
if(pN.sort !== null) prm[pN.sort]= ts.p.sortname; if(pN.order !== null) prm[pN.order]= ts.p.sortorder;
|
577
595
|
$.extend(ts.p.postData,prm);
|
578
596
|
var rcnt = ts.p.scroll===false ? 0 : ts.rows.length-1;
|
579
|
-
if ($.isFunction(ts.p.datatype)) { ts.p.datatype(
|
597
|
+
if ($.isFunction(ts.p.datatype)) { ts.p.datatype(ts.p.postData,"load_"+ts.p.id); return;}
|
580
598
|
else if(beReq) {ts.p.beforeRequest();}
|
581
599
|
dt = ts.p.datatype.toLowerCase();
|
582
600
|
switch(dt)
|
583
601
|
{
|
584
602
|
case "json":
|
603
|
+
case "jsonp":
|
585
604
|
case "xml":
|
586
605
|
case "script":
|
587
606
|
$.ajax({url:ts.p.url,type:ts.p.mtype,dataType: dt ,data: ts.p.postData,
|
588
607
|
complete:function(req,st) {
|
589
608
|
if(st=="success" || (req.statusText == "OK" && req.status == "200")) {
|
590
|
-
if(dt === "json" || dt === "script") addJSONData($.jgrid.parse(req.responseText),ts.grid.bDiv,rcnt);
|
591
609
|
if(dt === "xml") addXmlData(req.responseXML,ts.grid.bDiv,rcnt);
|
610
|
+
else addJSONData($.jgrid.parse(req.responseText),ts.grid.bDiv,rcnt);
|
592
611
|
if(loadComplete) loadComplete(req);
|
593
612
|
}
|
594
613
|
req=null;
|
@@ -635,7 +654,7 @@ $.fn.jqGrid = function( p ) {
|
|
635
654
|
}
|
636
655
|
},
|
637
656
|
beginReq = function() {
|
638
|
-
grid.hDiv.loading = true;
|
657
|
+
ts.grid.hDiv.loading = true;
|
639
658
|
if(ts.p.hiddengrid) { return;}
|
640
659
|
switch(ts.p.loadui) {
|
641
660
|
case "disable":
|
@@ -650,7 +669,7 @@ $.fn.jqGrid = function( p ) {
|
|
650
669
|
}
|
651
670
|
},
|
652
671
|
endReq = function() {
|
653
|
-
grid.hDiv.loading = false;
|
672
|
+
ts.grid.hDiv.loading = false;
|
654
673
|
switch(ts.p.loadui) {
|
655
674
|
case "disable":
|
656
675
|
break;
|
@@ -779,12 +798,12 @@ $.fn.jqGrid = function( p ) {
|
|
779
798
|
pgl += "<td>"+str+"</td>";
|
780
799
|
}
|
781
800
|
pgl += "</tr></tbody></table>";
|
782
|
-
if(ts.p.viewrecords===true) {$("td#"+pgid+"_"+ts.p.recordpos,"#"+pgcnt).append("<div class='ui-paging-info'></div>");}
|
801
|
+
if(ts.p.viewrecords===true) {$("td#"+pgid+"_"+ts.p.recordpos,"#"+pgcnt).append("<div style='text-align:"+ts.p.recordpos+"' class='ui-paging-info'></div>");}
|
783
802
|
$("td#"+pgid+"_"+ts.p.pagerpos,"#"+pgcnt).append(pgl);
|
784
803
|
tdw = $(".ui-jqgrid").css("font-size") || "11px";
|
785
804
|
$('body').append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+tdw+";visibility:hidden;' ></div>");
|
786
805
|
twd = $(pgl).clone().appendTo("#testpg").width();
|
787
|
-
|
806
|
+
$("#testpg").remove();
|
788
807
|
if(twd > 0) {
|
789
808
|
twd += 25;
|
790
809
|
$("td#"+pgid+"_"+ts.p.pagerpos,"#"+pgcnt).width(twd);
|
@@ -794,7 +813,8 @@ $.fn.jqGrid = function( p ) {
|
|
794
813
|
ts.p._nvtd[1] = 0;
|
795
814
|
pgl=null;
|
796
815
|
$('.ui-pg-selbox',"#"+pgcnt).bind('change',function() {
|
797
|
-
ts.p.
|
816
|
+
ts.p.page = Math.round(ts.p.rowNum*(ts.p.page-1)/this.value-0.5)+1;
|
817
|
+
ts.p.rowNum = this.value;
|
798
818
|
clearVals('records');
|
799
819
|
populate();
|
800
820
|
return false;
|
@@ -864,7 +884,7 @@ $.fn.jqGrid = function( p ) {
|
|
864
884
|
if(ts.p.lastsort == idxcol && ts.p.sortorder == sor) return;
|
865
885
|
else ts.p.sortorder = sor;
|
866
886
|
}
|
867
|
-
var thd= $("thead:first",grid.hDiv).get(0);
|
887
|
+
var thd= $("thead:first",ts.grid.hDiv).get(0);
|
868
888
|
$("tr th:eq("+ts.p.lastsort+") span.ui-grid-ico-sort",thd).addClass('ui-state-disabled');
|
869
889
|
$("tr th:eq("+ts.p.lastsort+")",thd).attr("aria-selected","false");
|
870
890
|
$("tr th:eq("+idxcol+") span.ui-icon-"+ts.p.sortorder,thd).removeClass('ui-state-disabled');
|
@@ -1127,10 +1147,9 @@ $.fn.jqGrid = function( p ) {
|
|
1127
1147
|
$(grid.hDiv)
|
1128
1148
|
.css({ width: grid.width+"px"})
|
1129
1149
|
.addClass("ui-state-default ui-jqgrid-hdiv")
|
1130
|
-
.append(hb)
|
1131
|
-
.bind("selectstart", function () { return false; });
|
1150
|
+
.append(hb);
|
1132
1151
|
$(hb).append(hTable);
|
1133
|
-
if(hg)
|
1152
|
+
if(hg) $(grid.hDiv).hide();
|
1134
1153
|
ts.p._height =0;
|
1135
1154
|
if(ts.p.pager){
|
1136
1155
|
if(typeof ts.p.pager == "string") {if(ts.p.pager.substr(0,1) !="#") ts.p.pager = "#"+ts.p.pager;}
|
@@ -1158,15 +1177,15 @@ $.fn.jqGrid = function( p ) {
|
|
1158
1177
|
var scb = $(td).hasClass("cbox");
|
1159
1178
|
ptr = $(td,ts.rows).parents("tr.jqgrow");
|
1160
1179
|
if($(ptr).length === 0 ) {
|
1161
|
-
return
|
1180
|
+
return this;
|
1162
1181
|
}
|
1163
1182
|
var cSel = true;
|
1164
|
-
if(bSR) cSel = bSR(ptr[0].id);
|
1165
|
-
if (td.tagName == 'A') { return true; }
|
1183
|
+
if(bSR) cSel = bSR(ptr[0].id, e);
|
1184
|
+
if (td.tagName == 'A' || ((td.tagName == 'INPUT' || td.tagName == 'TEXTAREA' || td.tagName == 'OPTION' || td.tagName == 'SELECT' ) && !scb) ) { return true; }
|
1166
1185
|
if(cSel === true) {
|
1167
1186
|
if(ts.p.cellEdit === true) {
|
1168
1187
|
if(ts.p.multiselect && scb){
|
1169
|
-
$(ts).setSelection(
|
1188
|
+
$(ts).setSelection(ptr[0].id,true);
|
1170
1189
|
} else {
|
1171
1190
|
ri = ptr[0].rowIndex;
|
1172
1191
|
ci = !$(td).is('td') ? $(td).parents("td:first")[0].cellIndex : td.cellIndex;
|
@@ -1175,7 +1194,7 @@ $.fn.jqGrid = function( p ) {
|
|
1175
1194
|
}
|
1176
1195
|
} else if ( !ts.p.multikey ) {
|
1177
1196
|
if(ts.p.multiselect && ts.p.multiboxonly) {
|
1178
|
-
if(scb){$(ts).setSelection(
|
1197
|
+
if(scb){$(ts).setSelection(ptr[0].id,true);}
|
1179
1198
|
else {
|
1180
1199
|
$(ts.p.selarrrow).each(function(i,n){
|
1181
1200
|
var ind = ts.rows.namedItem(n);
|
@@ -1184,14 +1203,14 @@ $.fn.jqGrid = function( p ) {
|
|
1184
1203
|
});
|
1185
1204
|
ts.p.selarrrow = [];
|
1186
1205
|
$("#cb_jqg",ts.grid.hDiv).attr("checked",false);
|
1187
|
-
$(ts).setSelection(
|
1206
|
+
$(ts).setSelection(ptr[0].id,true);
|
1188
1207
|
}
|
1189
1208
|
} else {
|
1190
|
-
$(ts).setSelection(
|
1209
|
+
$(ts).setSelection(ptr[0].id,true);
|
1191
1210
|
}
|
1192
1211
|
} else {
|
1193
1212
|
if(e[ts.p.multikey]) {
|
1194
|
-
$(ts).setSelection(
|
1213
|
+
$(ts).setSelection(ptr[0].id,true);
|
1195
1214
|
} else if(ts.p.multiselect && scb) {
|
1196
1215
|
scb = $("[id^=jqg_]",ptr).attr("checked");
|
1197
1216
|
$("[id^=jqg_]",ptr).attr("checked",!scb);
|
@@ -1234,7 +1253,7 @@ $.fn.jqGrid = function( p ) {
|
|
1234
1253
|
td = e.target;
|
1235
1254
|
ptr = $(td,ts.rows).parents("tr.jqgrow");
|
1236
1255
|
if($(ptr).length === 0 ){return false;}
|
1237
|
-
if(!ts.p.multiselect) { $(ts).setSelection(
|
1256
|
+
if(!ts.p.multiselect) { $(ts).setSelection(ptr[0].id,true); }
|
1238
1257
|
ri = ptr[0].rowIndex;
|
1239
1258
|
ci = !$(td).is('td') ? $(td).parents("td:first")[0].cellIndex : td.cellIndex;
|
1240
1259
|
if(isMSIE) {ci = $.jgrid.getAbsoluteIndex(ptr[0],ci);}
|
@@ -1250,7 +1269,7 @@ $.fn.jqGrid = function( p ) {
|
|
1250
1269
|
.scroll(function (e) {grid.scrollGrid();});
|
1251
1270
|
$("table:first",grid.bDiv).css({width:ts.p.tblwidth+"px"});
|
1252
1271
|
if( isMSIE ) {
|
1253
|
-
if( $("tbody",this).size()
|
1272
|
+
if( $("tbody",this).size() == 2 ) { $("tbody:first",this).remove();}
|
1254
1273
|
if( ts.p.multikey) {$(grid.bDiv).bind("selectstart",function(){return false;});}
|
1255
1274
|
} else {
|
1256
1275
|
if( ts.p.multikey) {$(grid.bDiv).bind("mousedown",function(){return false;});}
|
@@ -1293,40 +1312,42 @@ $.fn.jqGrid = function( p ) {
|
|
1293
1312
|
ts.p._height += parseInt($(grid.cDiv,ts).height(),10);
|
1294
1313
|
var tdt = ts.p.datatype;
|
1295
1314
|
if(ts.p.hidegrid===true) {
|
1296
|
-
$(".ui-jqgrid-titlebar-close",grid.cDiv).
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
if(
|
1301
|
-
|
1315
|
+
$(".ui-jqgrid-titlebar-close",grid.cDiv).click( function(){
|
1316
|
+
if(ts.p.gridstate == 'visible') {
|
1317
|
+
$(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+ts.p.id).slideUp("fast");
|
1318
|
+
if(ts.p.pager) {$(ts.p.pager).slideUp("fast");}
|
1319
|
+
if(ts.p.toolbar[0]===true) {
|
1320
|
+
if( ts.p.toolbar[1]=='both') {
|
1321
|
+
$(grid.ubDiv).slideUp("fast");
|
1322
|
+
}
|
1323
|
+
$(grid.uDiv).slideUp("fast");
|
1302
1324
|
}
|
1303
|
-
$(
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
ts.p.gridstate
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
$(grid.ubDiv).slideDown("fast");
|
1325
|
+
if(ts.p.footerrow) $(".ui-jqgrid-sdiv","#gbox_"+ts.p.id).slideUp("fast");
|
1326
|
+
$("span",this).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");
|
1327
|
+
ts.p.gridstate = 'hidden';
|
1328
|
+
if(onHdCl) {if(!hg) {ts.p.onHeaderClick(ts.p.gridstate);}}
|
1329
|
+
} else if(ts.p.gridstate == 'hidden'){
|
1330
|
+
$(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+ts.p.id).slideDown("fast");
|
1331
|
+
if(ts.p.pager) {$(ts.p.pager).slideDown("fast");}
|
1332
|
+
if(ts.p.toolbar[0]===true) {
|
1333
|
+
if( ts.p.toolbar[1]=='both') {
|
1334
|
+
$(grid.ubDiv).slideDown("fast");
|
1335
|
+
}
|
1336
|
+
$(grid.uDiv).slideDown("fast");
|
1316
1337
|
}
|
1317
|
-
$(
|
1338
|
+
if(ts.p.footerrow) $(".ui-jqgrid-sdiv","#gbox_"+ts.p.id).slideDown("fast");
|
1339
|
+
$("span",this).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");
|
1340
|
+
if(hg) {ts.p.datatype = tdt;populate();hg=false;}
|
1341
|
+
ts.p.gridstate = 'visible';
|
1342
|
+
if(onHdCl) {ts.p.onHeaderClick(ts.p.gridstate)}
|
1318
1343
|
}
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
ts.p.gridstate = 'visible';
|
1323
|
-
if(onHdCl) {ts.p.onHeaderClick(ts.p.gridstate)}
|
1324
|
-
}
|
1325
|
-
);
|
1326
|
-
if(hg) { $(".ui-jqgrid-titlebar-close",grid.cDiv).trigger("click"); ts.p.datatype="local";}
|
1344
|
+
return false;
|
1345
|
+
});
|
1346
|
+
if(hg) {ts.p.datatype="local"; $(".ui-jqgrid-titlebar-close",grid.cDiv).trigger("click");}
|
1327
1347
|
}
|
1328
1348
|
} else {$(grid.cDiv).hide();}
|
1329
|
-
$(grid.hDiv).after(grid.bDiv)
|
1349
|
+
$(grid.hDiv).after(grid.bDiv);
|
1350
|
+
$(".ui-jqgrid-labels",grid.hDiv).bind("selectstart", function () { return false; })
|
1330
1351
|
.mousemove(function (e) {
|
1331
1352
|
if(grid.resizing){grid.dragMove(e);}
|
1332
1353
|
return false;
|
@@ -1387,14 +1408,13 @@ $.fn.extend({
|
|
1387
1408
|
});
|
1388
1409
|
return ids;
|
1389
1410
|
},
|
1390
|
-
setSelection : function(selection,onsr
|
1411
|
+
setSelection : function(selection,onsr) {
|
1391
1412
|
return this.each(function(){
|
1392
1413
|
var $t = this, stat,pt, olr, ner, ia, tpsr;
|
1414
|
+
if(selection === undefined) return;
|
1393
1415
|
onsr = onsr === false ? false : true;
|
1394
|
-
|
1395
|
-
|
1396
|
-
selection = $(pt).attr("id");
|
1397
|
-
if (!pt.html()) {return;}
|
1416
|
+
pt=$t.rows.namedItem(selection);
|
1417
|
+
if(pt==null) return;
|
1398
1418
|
if($t.p.selrow && $t.p.scrollrows===true) {
|
1399
1419
|
olr = $t.rows.namedItem($t.p.selrow).rowIndex;
|
1400
1420
|
ner = $t.rows.namedItem(selection).rowIndex;
|
@@ -1429,7 +1449,7 @@ $.fn.extend({
|
|
1429
1449
|
$t.p.selarrrow.splice(ia,1);
|
1430
1450
|
if( $t.p.onSelectRow && onsr) { $t.p.onSelectRow($t.p.selrow, stat); }
|
1431
1451
|
tpsr = $t.p.selarrrow[0];
|
1432
|
-
$t.p.selrow = (tpsr
|
1452
|
+
$t.p.selrow = (tpsr === undefined) ? null : tpsr;
|
1433
1453
|
}
|
1434
1454
|
}
|
1435
1455
|
function scrGrid(iR,tp){
|
@@ -1478,7 +1498,11 @@ $.fn.extend({
|
|
1478
1498
|
if($t.p.treeGrid===true && nm == $t.p.ExpandColumn) {
|
1479
1499
|
res[nm] = $.jgrid.htmlDecode($("span:first",this).html());
|
1480
1500
|
} else {
|
1481
|
-
|
1501
|
+
try {
|
1502
|
+
res[nm] = $.unformat(this,{colModel:$t.p.colModel[i]},i)
|
1503
|
+
} catch (e){
|
1504
|
+
res[nm] = $.jgrid.htmlDecode($(this).html());
|
1505
|
+
}
|
1482
1506
|
}
|
1483
1507
|
}
|
1484
1508
|
});
|
@@ -1520,7 +1544,7 @@ $.fn.extend({
|
|
1520
1544
|
this.each(function(){
|
1521
1545
|
var t = this, vl, ind;
|
1522
1546
|
if(!t.grid) {return false;}
|
1523
|
-
|
1547
|
+
ind = t.rows.namedItem(rowid);
|
1524
1548
|
if(!ind) return false;
|
1525
1549
|
if( data ) {
|
1526
1550
|
$(this.p.colModel).each(function(i){
|
@@ -1589,13 +1613,13 @@ $.fn.extend({
|
|
1589
1613
|
break;
|
1590
1614
|
case 'before':
|
1591
1615
|
sind = t.rows.namedItem(src);
|
1592
|
-
sind != null
|
1616
|
+
if(sind != null) {$(sind).before(row); sind=sind.rowIndex;};
|
1593
1617
|
break;
|
1594
1618
|
}
|
1595
1619
|
}
|
1596
1620
|
t.p.records++;
|
1597
1621
|
t.p.reccount++;
|
1598
|
-
if(pos==='first' || (pos==='before' && sind
|
1622
|
+
if(pos==='first' || (pos==='before' && sind == 0) || t.rows.length === 1 ){
|
1599
1623
|
t.updateColumns();
|
1600
1624
|
}
|
1601
1625
|
if( t.p.altRows === true ) {
|
@@ -1724,7 +1748,7 @@ $.fn.extend({
|
|
1724
1748
|
}
|
1725
1749
|
}
|
1726
1750
|
initwidth =0;
|
1727
|
-
var
|
1751
|
+
var cle = $t.grid.cols.length >0;
|
1728
1752
|
$.each($t.p.colModel, function(i) {
|
1729
1753
|
var tn = this.name;
|
1730
1754
|
if(this.hidden === false && tn !== 'cb' && tn !== 'subgrid' && tn !== 'rn'){
|
@@ -1734,7 +1758,7 @@ $.fn.extend({
|
|
1734
1758
|
$t.grid.headers[i].width=cw;
|
1735
1759
|
$t.grid.headers[i].el.style.width=cw+"px";
|
1736
1760
|
if($t.p.footerrow) $t.grid.footers[i].style.width = cw+"px";
|
1737
|
-
if(
|
1761
|
+
if(cle) $t.grid.cols[i].style.width = cw+"px";
|
1738
1762
|
lvc = i;
|
1739
1763
|
}
|
1740
1764
|
});
|
@@ -1790,6 +1814,7 @@ $.fn.extend({
|
|
1790
1814
|
var thecol = $("tr.ui-jqgrid-labels th:eq("+pos+")",$t.grid.hDiv);
|
1791
1815
|
if (nData){
|
1792
1816
|
$("div",thecol).html(nData);
|
1817
|
+
$t.p.colNames[pos] = nData;
|
1793
1818
|
}
|
1794
1819
|
if (prop) {
|
1795
1820
|
if(typeof prop === 'string') {$(thecol).addClass(prop);} else {$(thecol).css(prop);}
|
@@ -1840,14 +1865,19 @@ $.fn.extend({
|
|
1840
1865
|
if(pos>=0) {
|
1841
1866
|
var ind = $t.rows.namedItem(rowid);
|
1842
1867
|
if(ind) {
|
1843
|
-
|
1868
|
+
try {
|
1869
|
+
ret = $.unformat($("td:eq("+pos+")",ind),{colModel:$t.p.colModel[pos]},pos)
|
1870
|
+
} catch (e){
|
1871
|
+
ret = $.jgrid.htmlDecode($("td:eq("+pos+")",ind).html());
|
1872
|
+
}
|
1844
1873
|
}
|
1845
1874
|
}
|
1846
1875
|
});
|
1847
1876
|
return ret;
|
1848
1877
|
},
|
1849
|
-
getCol : function (col) {
|
1850
|
-
var ret = [];
|
1878
|
+
getCol : function (col, obj) {
|
1879
|
+
var ret = [], val;
|
1880
|
+
obj = obj==false ? false : true;
|
1851
1881
|
this.each(function(){
|
1852
1882
|
var $t=this, pos=-1;
|
1853
1883
|
if(!$t.grid) {return;}
|
@@ -1862,7 +1892,8 @@ $.fn.extend({
|
|
1862
1892
|
var ln = $t.rows.length, i =0;
|
1863
1893
|
if (ln && ln>0){
|
1864
1894
|
while(i<ln){
|
1865
|
-
|
1895
|
+
val = $t.rows[i].cells[pos].innerHTML;
|
1896
|
+
obj ? ret.push({id:$t.rows[i].id,value:val}) : ret[i]=val;
|
1866
1897
|
i++;
|
1867
1898
|
}
|
1868
1899
|
}
|
@@ -1870,11 +1901,13 @@ $.fn.extend({
|
|
1870
1901
|
});
|
1871
1902
|
return ret;
|
1872
1903
|
},
|
1873
|
-
clearGridData : function() {
|
1904
|
+
clearGridData : function(clearfooter) {
|
1874
1905
|
return this.each(function(){
|
1875
1906
|
var $t = this;
|
1876
1907
|
if(!$t.grid) {return;}
|
1908
|
+
if(typeof clearfooter != 'boolean') clearfooter = false;
|
1877
1909
|
$("tbody:first tr", $t.grid.bDiv).remove();
|
1910
|
+
if($t.p.footerrow && clearfooter) $(".ui-jqgrid-ftable td",$t.grid.sDiv).html(" ");
|
1878
1911
|
$t.p.selrow = null; $t.p.selarrrow= []; $t.p.savedRow = [];
|
1879
1912
|
$t.p.records = 0;$t.p.page='0';$t.p.lastpage='0';$t.p.reccount=0;
|
1880
1913
|
$t.updatepager(true);
|
@@ -1963,16 +1996,16 @@ $.fn.extend({
|
|
1963
1996
|
try {
|
1964
1997
|
tmp = $.unformat(cc,{colModel:$t.p.colModel[iCol]},iCol);
|
1965
1998
|
} catch (_) {
|
1966
|
-
tmp =
|
1999
|
+
tmp = $(cc).html();
|
1967
2000
|
}
|
1968
|
-
var opt = $.extend({}, $t.p.colModel[iCol].editoptions || {} ,{id:iRow+"_"+nm,name:nm});
|
1969
2001
|
if (!$t.p.colModel[iCol].edittype) {$t.p.colModel[iCol].edittype = "text";}
|
1970
2002
|
$t.p.savedRow.push({id:iRow,ic:iCol,name:nm,v:tmp});
|
1971
2003
|
if($.isFunction($t.p.formatCell)) {
|
1972
2004
|
var tmp2 = $t.p.formatCell($t.rows[iRow].id,nm,tmp,iRow,iCol);
|
1973
2005
|
if(tmp2) {tmp = tmp2;}
|
1974
2006
|
}
|
1975
|
-
var
|
2007
|
+
var opt = $.extend({}, $t.p.colModel[iCol].editoptions || {} ,{id:iRow+"_"+nm,name:nm});
|
2008
|
+
var elc = createEl($t.p.colModel[iCol].edittype,opt,tmp,true);
|
1976
2009
|
if ($.isFunction($t.p.beforeEditCell)) {
|
1977
2010
|
$t.p.beforeEditCell($t.rows[iRow].id,nm,tmp,iRow,iCol);
|
1978
2011
|
}
|
@@ -2016,10 +2049,10 @@ $.fn.extend({
|
|
2016
2049
|
switch ($t.p.colModel[iCol].edittype) {
|
2017
2050
|
case "select":
|
2018
2051
|
if(!$t.p.colModel[iCol].editoptions.multiple) {
|
2019
|
-
v = $("#"+iRow+"_"+nm
|
2020
|
-
v2 = $("#"+iRow+"_"+nm
|
2052
|
+
v = $("#"+iRow+"_"+nm+">option:selected",$t.rows[iRow]).val();
|
2053
|
+
v2 = $("#"+iRow+"_"+nm+">option:selected",$t.rows[iRow]).text();
|
2021
2054
|
} else {
|
2022
|
-
var sel = $("#"+iRow+"_"+nm
|
2055
|
+
var sel = $("#"+iRow+"_"+nm,$t.rows[iRow]), selectedText = [];
|
2023
2056
|
v = $(sel).val();
|
2024
2057
|
if(v) v.join(","); else v="";
|
2025
2058
|
$("option:selected",sel).each(
|
@@ -2029,6 +2062,7 @@ $.fn.extend({
|
|
2029
2062
|
);
|
2030
2063
|
v2 = selectedText.join(",");
|
2031
2064
|
}
|
2065
|
+
if($t.p.colModel[iCol].formatter) v2 = v;
|
2032
2066
|
break;
|
2033
2067
|
case "checkbox":
|
2034
2068
|
var cbv = ["Yes","No"];
|
@@ -2059,6 +2093,7 @@ $.fn.extend({
|
|
2059
2093
|
addpost = $t.p.beforeSubmitCell($t.rows[iRow].id,nm, v, iRow,iCol);
|
2060
2094
|
if (!addpost) {addpost={};}
|
2061
2095
|
}
|
2096
|
+
if(v2=="") v2=" ";
|
2062
2097
|
if ($t.p.cellsubmit == 'remote') {
|
2063
2098
|
if ($t.p.cellurl) {
|
2064
2099
|
var postdata = {};
|
@@ -2452,7 +2487,6 @@ var viewModal = function (selector,o){
|
|
2452
2487
|
jQuery(selector).show().attr("aria-hidden","false");
|
2453
2488
|
try{jQuery(':input:visible',selector)[0].focus();}catch(_){}
|
2454
2489
|
}
|
2455
|
-
return false;
|
2456
2490
|
};
|
2457
2491
|
var hideModal = function (selector,o) {
|
2458
2492
|
o = jQuery.extend({jqm : true, gb :''}, o || {});
|
@@ -2470,45 +2504,57 @@ var hideModal = function (selector,o) {
|
|
2470
2504
|
}
|
2471
2505
|
};
|
2472
2506
|
|
2473
|
-
function info_dialog(caption, content,c_b) {
|
2507
|
+
function info_dialog(caption, content,c_b, modalopt) {
|
2508
|
+
var mopt = {
|
2509
|
+
width:290,
|
2510
|
+
height:'auto',
|
2511
|
+
dataheight: 'auto',
|
2512
|
+
drag: true,
|
2513
|
+
resize: false,
|
2514
|
+
caption:"<b>"+caption+"</b>",
|
2515
|
+
left:250,
|
2516
|
+
top:170,
|
2517
|
+
jqModal : true,
|
2518
|
+
closeOnEscape : true,
|
2519
|
+
align: 'center',
|
2520
|
+
buttonalign : 'center'
|
2521
|
+
};
|
2522
|
+
jQuery.extend(mopt,modalopt || {});
|
2523
|
+
var jm = mopt.jqModal;
|
2524
|
+
if(jQuery.fn.jqm && !jm) jm = false;
|
2525
|
+
// in case there is no jqModal
|
2526
|
+
var dh = isNaN(mopt.dataheight) ? mopt.dataheight : mopt.dataheight+"px",
|
2527
|
+
cn = "text-align:"+mopt.align+";";
|
2474
2528
|
var cnt = "<div id='info_id'>";
|
2475
|
-
cnt += "<div
|
2476
|
-
cnt += "<
|
2477
|
-
cnt += "</div
|
2529
|
+
cnt += "<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+dh+";"+cn+"'>"+content+"</div>";
|
2530
|
+
cnt += c_b ? "<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+mopt.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+c_b+"</a></div>" : "";
|
2531
|
+
cnt += "</div>";
|
2532
|
+
|
2533
|
+
try {jQuery("#info_dialog").remove();} catch (e){}
|
2478
2534
|
createModal({
|
2479
2535
|
themodal:'info_dialog',
|
2480
2536
|
modalhead:'info_head',
|
2481
|
-
modalcontent:'info_content'
|
2537
|
+
modalcontent:'info_content',
|
2538
|
+
scrollelm: 'infocnt'},
|
2482
2539
|
cnt,
|
2483
|
-
|
2484
|
-
height:120,
|
2485
|
-
drag: false,
|
2486
|
-
resize: false,
|
2487
|
-
caption:"<b>"+caption+"</b>",
|
2488
|
-
left:250,
|
2489
|
-
top:170,
|
2490
|
-
closeOnEscape : true },
|
2540
|
+
mopt,
|
2491
2541
|
'','',true
|
2492
2542
|
);
|
2493
|
-
jQuery("#closedialog", "#info_id").
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2543
|
+
jQuery("#closedialog", "#info_id").click(function(e){
|
2544
|
+
hideModal("#info_dialog",{jqm:jm});
|
2545
|
+
return false;
|
2546
|
+
});
|
2547
|
+
jQuery(".fm-button","#info_dialog").hover(
|
2548
|
+
function(){jQuery(this).addClass('ui-state-hover');},
|
2549
|
+
function(){jQuery(this).removeClass('ui-state-hover');}
|
2498
2550
|
);
|
2499
|
-
if(jQuery.fn.jqm) {;}
|
2500
|
-
else {
|
2501
|
-
jQuery("#closedialog", "#info_id").click(function(e){
|
2502
|
-
hideModal("#info_dialog");
|
2503
|
-
return false;
|
2504
|
-
});
|
2505
|
-
}
|
2506
2551
|
viewModal("#info_dialog",{
|
2507
2552
|
onHide: function(h) {
|
2508
2553
|
h.w.hide().remove();
|
2509
2554
|
if(h.o) { h.o.remove(); }
|
2510
2555
|
},
|
2511
|
-
modal :true
|
2556
|
+
modal :true,
|
2557
|
+
jqm:jm
|
2512
2558
|
});
|
2513
2559
|
}
|
2514
2560
|
//Helper functions
|
@@ -2531,7 +2577,7 @@ function isArray(obj) {
|
|
2531
2577
|
}
|
2532
2578
|
}
|
2533
2579
|
// Form Functions
|
2534
|
-
function createEl(eltype,options,vl) {
|
2580
|
+
function createEl(eltype,options,vl,autowidth) {
|
2535
2581
|
var elem = "";
|
2536
2582
|
if(options.defaultValue) delete options['defaultValue'];
|
2537
2583
|
function bindEv (el, opt) {
|
@@ -2557,7 +2603,10 @@ function createEl(eltype,options,vl) {
|
|
2557
2603
|
{
|
2558
2604
|
case "textarea" :
|
2559
2605
|
elem = document.createElement("textarea");
|
2560
|
-
if(
|
2606
|
+
if(autowidth) {
|
2607
|
+
if(!options.cols) jQuery(elem).css({width:"98%"});
|
2608
|
+
} else if (!options.cols) options.cols = 20;
|
2609
|
+
if(!options.rows) options.rows = 2;
|
2561
2610
|
if(vl==' ' || vl==' ' || (vl.length==1 && vl.charCodeAt(0)==160)) {vl="";}
|
2562
2611
|
elem.value = vl;
|
2563
2612
|
options = bindEv(elem,options);
|
@@ -2602,7 +2651,7 @@ function createEl(eltype,options,vl) {
|
|
2602
2651
|
jQuery(elem).attr(options);
|
2603
2652
|
setTimeout(function(){
|
2604
2653
|
jQuery("option",elem).each(function(i){
|
2605
|
-
if(jQuery(this).html()==vl) {
|
2654
|
+
if(jQuery(this).text()==vl || jQuery(this).html()==vl) {
|
2606
2655
|
this.selected= "selected";
|
2607
2656
|
return false;
|
2608
2657
|
}
|
@@ -2618,34 +2667,32 @@ function createEl(eltype,options,vl) {
|
|
2618
2667
|
} else {
|
2619
2668
|
options.size = 1;
|
2620
2669
|
}
|
2670
|
+
if(typeof options.value === 'function') options.value = options.value();
|
2621
2671
|
if(typeof options.value === 'string') {
|
2622
2672
|
var so = options.value.split(";"),sv, ov;
|
2623
|
-
try {delete options['value'];} catch (e){}
|
2624
|
-
options = bindEv(elem,options);
|
2625
|
-
jQuery(elem).attr(options);
|
2626
2673
|
for(i=0; i<so.length;i++){
|
2627
2674
|
sv = so[i].split(":");
|
2628
2675
|
ov = document.createElement("option");
|
2629
2676
|
ov.value = sv[0]; ov.innerHTML = sv[1];
|
2630
|
-
if (!msl && sv[1]==vl) ov.selected ="selected";
|
2631
|
-
if (msl && jQuery.inArray(jQuery.
|
2677
|
+
if (!msl && (sv[0] == vl || sv[1]==vl)) ov.selected ="selected";
|
2678
|
+
if (msl && (jQuery.inArray(sv[1], ovm)>-1 || jQuery.inArray(sv[0], ovm)>-1)) {ov.selected ="selected";}
|
2632
2679
|
elem.appendChild(ov);
|
2633
2680
|
}
|
2634
2681
|
} else if (typeof options.value === 'object') {
|
2635
2682
|
var oSv = options.value;
|
2636
|
-
try {delete options['value'];} catch (e){}
|
2637
|
-
options = bindEv(elem,options);
|
2638
|
-
jQuery(elem).attr(options);
|
2639
2683
|
i=0;
|
2640
2684
|
for ( var key in oSv) {
|
2641
2685
|
i++;
|
2642
2686
|
ov = document.createElement("option");
|
2643
2687
|
ov.value = key; ov.innerHTML = oSv[key];
|
2644
|
-
if (!msl && oSv[key]==vl) ov.selected ="selected";
|
2645
|
-
if (msl && jQuery.inArray(
|
2688
|
+
if (!msl && (key == vl ||oSv[key]==vl) ) ov.selected ="selected";
|
2689
|
+
if (msl && (jQuery.inArray(oSv[key],ovm)>-1 || jQuery.inArray(key,ovm)>-1)) ov.selected ="selected";
|
2646
2690
|
elem.appendChild(ov);
|
2647
2691
|
}
|
2648
2692
|
}
|
2693
|
+
options = bindEv(elem,options);
|
2694
|
+
try {delete options['value'];} catch (e){}
|
2695
|
+
jQuery(elem).attr(options);
|
2649
2696
|
}
|
2650
2697
|
break;
|
2651
2698
|
case "text" :
|
@@ -2655,8 +2702,10 @@ function createEl(eltype,options,vl) {
|
|
2655
2702
|
elem.type = eltype;
|
2656
2703
|
elem.value = jQuery.jgrid.htmlDecode(vl);
|
2657
2704
|
options = bindEv(elem,options);
|
2658
|
-
if(
|
2659
|
-
|
2705
|
+
if(eltype != "button"){
|
2706
|
+
if(autowidth) {
|
2707
|
+
if(!options.size) jQuery(elem).css({width:"98%"});
|
2708
|
+
} else if (!options.size) options.size = 20;
|
2660
2709
|
}
|
2661
2710
|
jQuery(elem).attr(options);
|
2662
2711
|
break;
|
@@ -2682,7 +2731,7 @@ function checkValues(val, valref,g) {
|
|
2682
2731
|
}
|
2683
2732
|
}
|
2684
2733
|
} else if(valref >=0) {
|
2685
|
-
|
2734
|
+
edtrul = g.p.colModel[valref].editrules;
|
2686
2735
|
}
|
2687
2736
|
if(edtrul) {
|
2688
2737
|
if(!nm) nm = g.p.colNames[valref];
|
@@ -2696,10 +2745,10 @@ function checkValues(val, valref,g) {
|
|
2696
2745
|
if(isNaN(val)) return [false,nm+": "+jQuery.jgrid.edit.msg.number,""];
|
2697
2746
|
}
|
2698
2747
|
}
|
2699
|
-
if(edtrul.minValue && !isNaN(edtrul.minValue)) {
|
2748
|
+
if(typeof edtrul.minValue != 'undefined' && !isNaN(edtrul.minValue)) {
|
2700
2749
|
if (parseFloat(val) < parseFloat(edtrul.minValue) ) return [false,nm+": "+jQuery.jgrid.edit.msg.minValue+" "+edtrul.minValue,""];
|
2701
2750
|
}
|
2702
|
-
if(edtrul.maxValue && !isNaN(edtrul.maxValue)) {
|
2751
|
+
if(typeof edtrul.maxValue != 'undefined' && !isNaN(edtrul.maxValue)) {
|
2703
2752
|
if (parseFloat(val) > parseFloat(edtrul.maxValue) ) return [false,nm+": "+jQuery.jgrid.edit.msg.maxValue+" "+edtrul.maxValue,""];
|
2704
2753
|
}
|
2705
2754
|
var filter;
|
@@ -2722,9 +2771,14 @@ function checkValues(val, valref,g) {
|
|
2722
2771
|
if(!checkDate (dft, val)) return [false,nm+": "+jQuery.jgrid.edit.msg.date+" - "+dft,""];
|
2723
2772
|
}
|
2724
2773
|
}
|
2774
|
+
if(edtrul.time === true) {
|
2775
|
+
if( !(rqfield === false && isEmpty(val)) ) {
|
2776
|
+
if(!checkTime (val)) return [false,nm+": "+jQuery.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];
|
2777
|
+
}
|
2778
|
+
}
|
2725
2779
|
if(edtrul.url === true) {
|
2726
2780
|
if( !(rqfield === false && isEmpty(val)) ) {
|
2727
|
-
filter = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w
|
2781
|
+
filter = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
|
2728
2782
|
if(!filter.test(val)) {return [false,nm+": "+jQuery.jgrid.edit.msg.url,""];}
|
2729
2783
|
}
|
2730
2784
|
}
|
@@ -2815,7 +2869,29 @@ function isEmpty(val)
|
|
2815
2869
|
return false;
|
2816
2870
|
}
|
2817
2871
|
}
|
2818
|
-
|
2872
|
+
function checkTime(time){
|
2873
|
+
// checks only hh:ss (and optional am/pm)
|
2874
|
+
var re = /^(\d{1,2}):(\d{2})([ap]m)?$/,regs;
|
2875
|
+
if(!isEmpty(time))
|
2876
|
+
{
|
2877
|
+
regs = time.match(re);
|
2878
|
+
if(regs) {
|
2879
|
+
if(regs[3]) {
|
2880
|
+
if(regs[1] < 1 || regs[1] > 12)
|
2881
|
+
return false;
|
2882
|
+
} else {
|
2883
|
+
if(regs[1] > 23)
|
2884
|
+
return false;
|
2885
|
+
}
|
2886
|
+
if(regs[2] > 59) {
|
2887
|
+
return false;
|
2888
|
+
}
|
2889
|
+
} else {
|
2890
|
+
return false;
|
2891
|
+
}
|
2892
|
+
}
|
2893
|
+
return true;
|
2894
|
+
}
|
2819
2895
|
|
2820
2896
|
;(function($){
|
2821
2897
|
/**
|
@@ -2908,6 +2984,38 @@ $.fn.extend({
|
|
2908
2984
|
$("#gbox_"+gid).remove();
|
2909
2985
|
});
|
2910
2986
|
},
|
2987
|
+
setGridState : function(state) {
|
2988
|
+
return this.each(function(){
|
2989
|
+
if ( !this.grid ) {return;}
|
2990
|
+
$t = this;
|
2991
|
+
if(state == 'hidden'){
|
2992
|
+
$(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+$t.p.id).slideUp("fast");
|
2993
|
+
if($t.p.pager) {$($t.p.pager).slideUp("fast");}
|
2994
|
+
if($t.p.toolbar[0]===true) {
|
2995
|
+
if( $t.p.toolbar[1]=='both') {
|
2996
|
+
$($t.grid.ubDiv).slideUp("fast");
|
2997
|
+
}
|
2998
|
+
$($t.grid.uDiv).slideUp("fast");
|
2999
|
+
}
|
3000
|
+
if($t.p.footerrow) $(".ui-jqgrid-sdiv","#gbox_"+$s.p.id).slideUp("fast");
|
3001
|
+
$(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");
|
3002
|
+
$t.p.gridstate = 'hidden';
|
3003
|
+
} else if(state=='visible') {
|
3004
|
+
$(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+$t.p.id).slideDown("fast");
|
3005
|
+
if($t.p.pager) {$($t.p.pager).slideDown("fast");}
|
3006
|
+
if($t.p.toolbar[0]===true) {
|
3007
|
+
if( $t.p.toolbar[1]=='both') {
|
3008
|
+
$($t.grid.ubDiv).slideDown("fast");
|
3009
|
+
}
|
3010
|
+
$($t.grid.uDiv).slideDown("fast");
|
3011
|
+
}
|
3012
|
+
if($t.p.footerrow) $(".ui-jqgrid-sdiv","#gbox_"+$t.p.id).slideDown("fast");
|
3013
|
+
$(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");
|
3014
|
+
$t.p.gridstate = 'visible';
|
3015
|
+
}
|
3016
|
+
|
3017
|
+
});
|
3018
|
+
},
|
2911
3019
|
updateGridRows : function (data, rowidname, jsonreader) {
|
2912
3020
|
var nm, success=false;
|
2913
3021
|
this.each(function(){
|
@@ -3420,7 +3528,7 @@ $.fn.extend({
|
|
3420
3528
|
$.each($t.p.colModel,function(i,n){
|
3421
3529
|
var cm=this;
|
3422
3530
|
th = $("<th role='columnheader' class='ui-state-default ui-th-column'></th>");
|
3423
|
-
thd = $("<div style='width:100%;position:relative;'></div>");
|
3531
|
+
thd = $("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");
|
3424
3532
|
if(this.hidden===true) { $(th).css("display","none");}
|
3425
3533
|
this.search = this.search === false ? false : true;
|
3426
3534
|
if(typeof this.stype == 'undefined' ) {this.stype='text';}
|
@@ -3648,7 +3756,7 @@ $.fn.extend({
|
|
3648
3756
|
}
|
3649
3757
|
function searchFilters(filters) {
|
3650
3758
|
var hasFilters = (filters !== undefined),
|
3651
|
-
grid = jQuery("#"+$t.p.id), sdata=
|
3759
|
+
grid = jQuery("#"+$t.p.id), sdata={};
|
3652
3760
|
if(p.multipleSearch===false) {
|
3653
3761
|
sdata[p.sField] = filters.rules[0].field;
|
3654
3762
|
sdata[p.sValue] = filters.rules[0].data;
|
@@ -3703,6 +3811,7 @@ $.fn.extend({
|
|
3703
3811
|
url: null,
|
3704
3812
|
mtype : "POST",
|
3705
3813
|
closeAfterAdd : false,
|
3814
|
+
clearAfterAdd :true,
|
3706
3815
|
closeAfterEdit : false,
|
3707
3816
|
reloadAfterSubmit : true,
|
3708
3817
|
onInitializeForm: null,
|
@@ -4133,8 +4242,9 @@ $.fn.extend({
|
|
4133
4242
|
function fillData(rowid,obj,fmid){
|
4134
4243
|
var nm, hc,cnt=0,tmp, fld,opt,vl,vlc;
|
4135
4244
|
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {rp_ge._savedData = {};rp_ge._savedData.id=rowid;}
|
4245
|
+
var cm = obj.p.colModel;
|
4136
4246
|
if(rowid == '_empty') {
|
4137
|
-
$(
|
4247
|
+
$(cm).each(function(i){
|
4138
4248
|
nm = this.name.replace('.',"\\.");
|
4139
4249
|
opt = $.extend({}, this.editoptions || {} );
|
4140
4250
|
fld = $("#"+nm,"#"+fmid);
|
@@ -4157,6 +4267,8 @@ $.fn.extend({
|
|
4157
4267
|
fld[0].checked = false;
|
4158
4268
|
fld[0].defaultChecked = false;
|
4159
4269
|
vl = $(fld).attr("offval");
|
4270
|
+
} else if (fld[0].type.substr(0,6)=='select') {
|
4271
|
+
fld[0].selectedIndex = 0;
|
4160
4272
|
} else {
|
4161
4273
|
fld.val(vl);
|
4162
4274
|
}
|
@@ -4167,26 +4279,28 @@ $.fn.extend({
|
|
4167
4279
|
$("#id_g","#"+fmid).val("_empty");
|
4168
4280
|
return;
|
4169
4281
|
}
|
4170
|
-
$(
|
4171
|
-
|
4282
|
+
var tre = $(obj).getInd(rowid,true);
|
4283
|
+
if(!tre) return;
|
4284
|
+
$('td',tre).each( function(i) {
|
4285
|
+
nm = cm[i].name.replace('.',"\\.");
|
4172
4286
|
// hidden fields are included in the form
|
4173
|
-
if(
|
4287
|
+
if(cm[i].editrules && cm[i].editrules.edithidden === true) {
|
4174
4288
|
hc = false;
|
4175
4289
|
} else {
|
4176
|
-
hc =
|
4290
|
+
hc = cm[i].hidden === true ? true : false;
|
4177
4291
|
}
|
4178
|
-
if ( nm !== 'cb' && nm !== 'subgrid' &&
|
4292
|
+
if ( nm !== 'cb' && nm !== 'subgrid' && cm[i].editable===true) {
|
4179
4293
|
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
|
4180
4294
|
tmp = $(this).text();
|
4181
4295
|
} else {
|
4182
4296
|
try {
|
4183
|
-
tmp = $.unformat(this,{colModel:
|
4297
|
+
tmp = $.unformat(this,{colModel:cm[i]},i);
|
4184
4298
|
} catch (_) {
|
4185
4299
|
tmp = $(this).html();
|
4186
4300
|
}
|
4187
4301
|
}
|
4188
4302
|
if(rp_ge.checkOnSubmit===true || rp_ge.checkOnUpdate) rp_ge._savedData[nm] = tmp;
|
4189
|
-
switch (
|
4303
|
+
switch (cm[i].edittype) {
|
4190
4304
|
case "password":
|
4191
4305
|
case "text":
|
4192
4306
|
case "button" :
|
@@ -4199,12 +4313,11 @@ $.fn.extend({
|
|
4199
4313
|
$("#"+nm,"#"+fmid).val(tmp);
|
4200
4314
|
break;
|
4201
4315
|
case "select":
|
4202
|
-
tmp = $.jgrid.htmlDecode(tmp);
|
4203
4316
|
$("#"+nm+" option","#"+fmid).each(function(j){
|
4204
|
-
if (!
|
4317
|
+
if (!cm[i].editoptions.multiple && (tmp == $(this).text() || tmp == $(this).val()) ){
|
4205
4318
|
this.selected= true;
|
4206
|
-
} else if (
|
4207
|
-
if( $.inArray($(this).text(), tmp.split(",") ) > -1 ){
|
4319
|
+
} else if (cm[i].editoptions.multiple){
|
4320
|
+
if( $.inArray($(this).text(), tmp.split(",") ) > -1 || $.inArray($(this).val(), tmp.split(",") ) > -1 ){
|
4208
4321
|
this.selected = true;
|
4209
4322
|
}else{
|
4210
4323
|
this.selected = false;
|
@@ -4229,7 +4342,6 @@ $.fn.extend({
|
|
4229
4342
|
}
|
4230
4343
|
});
|
4231
4344
|
if(cnt>0) { $("#id_g","#"+frmtb).val(rowid); }
|
4232
|
-
return cnt;
|
4233
4345
|
}
|
4234
4346
|
function postIt() {
|
4235
4347
|
var copydata, ret=[true,"",""], onCS = {};
|
@@ -4238,7 +4350,7 @@ $.fn.extend({
|
|
4238
4350
|
if(ret[0] == false) break;
|
4239
4351
|
}
|
4240
4352
|
if(ret[0]) {
|
4241
|
-
if( $.isFunction( rp_ge.onclickSubmit)) { onCS = rp_ge.onclickSubmit(rp_ge) || {}; }
|
4353
|
+
if( $.isFunction( rp_ge.onclickSubmit)) { onCS = rp_ge.onclickSubmit(rp_ge,postdata) || {}; }
|
4242
4354
|
if( $.isFunction(rp_ge.beforeSubmit)) { ret = rp_ge.beforeSubmit(postdata,$("#"+frmgr)); }
|
4243
4355
|
}
|
4244
4356
|
gurl = rp_ge.url ? rp_ge.url : $t.p.editurl;
|
@@ -4262,8 +4374,12 @@ $.fn.extend({
|
|
4262
4374
|
data:postdata,
|
4263
4375
|
complete:function(data,Status){
|
4264
4376
|
if(Status != "success") {
|
4265
|
-
|
4266
|
-
|
4377
|
+
ret[0] = false;
|
4378
|
+
if ($.isFunction(rp_ge.errorTextFormat)) {
|
4379
|
+
ret[1] = rp_ge.errorTextFormat(data);
|
4380
|
+
} else {
|
4381
|
+
ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
|
4382
|
+
}
|
4267
4383
|
} else {
|
4268
4384
|
// data is posted successful
|
4269
4385
|
// execute aftersubmit with the returned data from server
|
@@ -4301,7 +4417,7 @@ $.fn.extend({
|
|
4301
4417
|
// the action is update
|
4302
4418
|
if(rp_ge.reloadAfterSubmit) {
|
4303
4419
|
$($t).trigger("reloadGrid");
|
4304
|
-
if( !rp_ge.closeAfterEdit ) { $($t).setSelection(postdata.id); }
|
4420
|
+
if( !rp_ge.closeAfterEdit ) { setTimeout(function(){$($t).setSelection(postdata.id);},1000); }
|
4305
4421
|
} else {
|
4306
4422
|
if($t.p.treeGrid === true) {
|
4307
4423
|
$($t).setTreeRow(postdata.id,postdata);
|
@@ -4581,8 +4697,10 @@ $.fn.extend({
|
|
4581
4697
|
return retpos;
|
4582
4698
|
};
|
4583
4699
|
function fillData(rowid,obj){
|
4584
|
-
var nm, hc,cnt=0,tmp, opt;
|
4585
|
-
$(
|
4700
|
+
var nm, hc,cnt=0,tmp, opt,trv;
|
4701
|
+
trv = $(obj).getInd(rowid,true);
|
4702
|
+
if(!trv) return;
|
4703
|
+
$('td',trv).each( function(i) {
|
4586
4704
|
nm = obj.p.colModel[i].name.replace('.',"\\.");
|
4587
4705
|
// hidden fields are included in the form
|
4588
4706
|
if(obj.p.colModel[i].editrules && obj.p.colModel[i].editrules.edithidden === true) {
|
@@ -4604,7 +4722,6 @@ $.fn.extend({
|
|
4604
4722
|
}
|
4605
4723
|
});
|
4606
4724
|
if(cnt>0) { $("#id_g","#"+frmtb).val(rowid); }
|
4607
|
-
return cnt;
|
4608
4725
|
};
|
4609
4726
|
});
|
4610
4727
|
},
|
@@ -4659,7 +4776,7 @@ $.fn.extend({
|
|
4659
4776
|
var tbl = "<div id='"+dtbl+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
|
4660
4777
|
tbl += "<table class='DelTable'><tbody>";
|
4661
4778
|
// error data
|
4662
|
-
tbl += "<tr id='DelError' style='display:none'><td ></td></tr>";
|
4779
|
+
tbl += "<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";
|
4663
4780
|
tbl += "<tr id='DelData' style='display:none'><td >"+rowids+"</td></tr>";
|
4664
4781
|
tbl += "<tr><td class=\"delmsg\" style=\"white-space:pre;\">"+p.msg+"</td></tr><tr><td > </td></tr>";
|
4665
4782
|
// buttons at footer
|
@@ -4705,7 +4822,11 @@ $.fn.extend({
|
|
4705
4822
|
complete:function(data,Status){
|
4706
4823
|
if(Status != "success") {
|
4707
4824
|
ret[0] = false;
|
4708
|
-
|
4825
|
+
if ($.isFunction(rp_ge.errorTextFormat)) {
|
4826
|
+
ret[1] = rp_ge.errorTextFormat(data);
|
4827
|
+
} else {
|
4828
|
+
ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
|
4829
|
+
}
|
4709
4830
|
} else {
|
4710
4831
|
// data is posted successful
|
4711
4832
|
// execute aftersubmit with the returned data from server
|
@@ -4783,7 +4904,8 @@ $.fn.extend({
|
|
4783
4904
|
view: false,
|
4784
4905
|
viewicon : "ui-icon-document",
|
4785
4906
|
position : "left",
|
4786
|
-
closeOnEscape : true
|
4907
|
+
closeOnEscape : true,
|
4908
|
+
afterRefresh : null
|
4787
4909
|
}, $.jgrid.nav, o ||{});
|
4788
4910
|
return this.each(function() {
|
4789
4911
|
var alertIDs = {themodal:'alertmod',modalhead:'alerthd',modalcontent:'alertcnt'},
|
@@ -4918,10 +5040,10 @@ $.fn.extend({
|
|
4918
5040
|
.attr({"title":o.refreshtitle || "",id: "refresh_"+$t.p.id})
|
4919
5041
|
.click(function(){
|
4920
5042
|
$t.p.search = false;
|
4921
|
-
|
5043
|
+
try {
|
4922
5044
|
var gID = $t.p.id;
|
4923
5045
|
$("#fbox_"+gID).searchFilter().reset();
|
4924
|
-
}
|
5046
|
+
} catch (e) {}
|
4925
5047
|
switch (o.refreshstate) {
|
4926
5048
|
case 'firstpage':
|
4927
5049
|
$t.p.page=1;
|
@@ -4945,6 +5067,7 @@ $.fn.extend({
|
|
4945
5067
|
},1000);
|
4946
5068
|
break;
|
4947
5069
|
}
|
5070
|
+
if($.isFunction(o.afterRefresh)) o.afterRefresh();
|
4948
5071
|
return false;
|
4949
5072
|
}).hover(function () {$(this).addClass("ui-state-hover");},
|
4950
5073
|
function () {$(this).removeClass("ui-state-hover");}
|
@@ -4954,7 +5077,7 @@ $.fn.extend({
|
|
4954
5077
|
tdw = $(".ui-jqgrid").css("font-size") || "11px";
|
4955
5078
|
$('body').append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+tdw+";visibility:hidden;' ></div>");
|
4956
5079
|
twd = $(navtbl).clone().appendTo("#testpg2").width();
|
4957
|
-
|
5080
|
+
$("#testpg2").remove();
|
4958
5081
|
$("#"+pgid+"_"+o.position,"#"+pgid).append(navtbl);
|
4959
5082
|
if($t.p._nvtd) {
|
4960
5083
|
if(twd > $t.p._nvtd[0] ) {
|
@@ -4971,7 +5094,8 @@ $.fn.extend({
|
|
4971
5094
|
title: '',
|
4972
5095
|
buttonicon : 'ui-icon-newwin',
|
4973
5096
|
onClickButton: null,
|
4974
|
-
position : "last"
|
5097
|
+
position : "last",
|
5098
|
+
cursor : 'pointer'
|
4975
5099
|
}, p ||{});
|
4976
5100
|
return this.each(function() {
|
4977
5101
|
if( !this.grid) { return; }
|
@@ -4999,7 +5123,8 @@ $.fn.extend({
|
|
4999
5123
|
.hover(
|
5000
5124
|
function () {$(this).addClass("ui-state-hover");},
|
5001
5125
|
function () {$(this).removeClass("ui-state-hover");}
|
5002
|
-
)
|
5126
|
+
)
|
5127
|
+
.css("cursor",p.cursor ? p.cursor : "normal");
|
5003
5128
|
}
|
5004
5129
|
});
|
5005
5130
|
},
|
@@ -5025,7 +5150,7 @@ $.fn.extend({
|
|
5025
5150
|
var rowdata = $($t).getRowData(rowid);
|
5026
5151
|
if (rowdata) {
|
5027
5152
|
for(var i in rowdata) {
|
5028
|
-
if ( $("[name="+i+"]",formid).is("input:radio") ) {
|
5153
|
+
if ( $("[name="+i+"]",formid).is("input:radio") || $("[name="+i+"]",formid).is("input:checkbox")) {
|
5029
5154
|
$("[name="+i+"]",formid).each( function() {
|
5030
5155
|
if( $(this).val() == rowdata[i] ) {
|
5031
5156
|
$(this).attr("checked","checked");
|
@@ -5041,16 +5166,19 @@ $.fn.extend({
|
|
5041
5166
|
}
|
5042
5167
|
});
|
5043
5168
|
},
|
5044
|
-
FormToGrid : function(rowid, formid){
|
5169
|
+
FormToGrid : function(rowid, formid, mode, position){
|
5045
5170
|
return this.each(function() {
|
5046
5171
|
var $t = this;
|
5047
5172
|
if(!$t.grid) { return; }
|
5173
|
+
if(!mode) mode = 'set';
|
5174
|
+
if(!position) position = 'first';
|
5048
5175
|
var fields = $(formid).serializeArray();
|
5049
5176
|
var griddata = {};
|
5050
5177
|
$.each(fields, function(i, field){
|
5051
5178
|
griddata[field.name] = field.value;
|
5052
5179
|
});
|
5053
|
-
$($t).
|
5180
|
+
if(mode=='add') $($t).addRowData(rowid,griddata, position);
|
5181
|
+
else if(mode=='set') $($t).setRowData(rowid,griddata);
|
5054
5182
|
});
|
5055
5183
|
}
|
5056
5184
|
});
|
@@ -5088,7 +5216,7 @@ $.fn.extend({
|
|
5088
5216
|
var XmlConvert = function (xml,o) {
|
5089
5217
|
var cnfg = $(o.xmlGrid.config,xml)[0];
|
5090
5218
|
var xmldata = $(o.xmlGrid.data,xml)[0];
|
5091
|
-
if(xmlJsonClass.xml2json && $.parse) {
|
5219
|
+
if(xmlJsonClass.xml2json && $.jgrid.parse) {
|
5092
5220
|
var jstr = xmlJsonClass.xml2json(cnfg," ");
|
5093
5221
|
var jstr = $.jgrid.parse(jstr);
|
5094
5222
|
for(var key in jstr) { var jstr1=jstr[key];}
|
@@ -5239,9 +5367,8 @@ $.fn.extend({
|
|
5239
5367
|
//Editing
|
5240
5368
|
editRow : function(rowid,keys,oneditfunc,succesfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc) {
|
5241
5369
|
return this.each(function(){
|
5242
|
-
var $t = this, nm, tmp, editable, cnt=0, focus=null, svr=
|
5370
|
+
var $t = this, nm, tmp, editable, cnt=0, focus=null, svr={}, ind,cm;
|
5243
5371
|
if (!$t.grid ) { return; }
|
5244
|
-
var hc;
|
5245
5372
|
ind = $($t).getInd(rowid,true);
|
5246
5373
|
if( ind == false ) {return;}
|
5247
5374
|
editable = $(ind).attr("editable") || "0";
|
@@ -5249,7 +5376,6 @@ $.fn.extend({
|
|
5249
5376
|
cm = $t.p.colModel;
|
5250
5377
|
$('td',ind).each( function(i) {
|
5251
5378
|
nm = cm[i].name;
|
5252
|
-
hc = cm[i].hidden===true ? true : false;
|
5253
5379
|
var treeg = $t.p.treeGrid===true && nm == $t.p.ExpandColumn;
|
5254
5380
|
if(treeg) tmp = $("span:first",this).html();
|
5255
5381
|
else {
|
@@ -5261,13 +5387,13 @@ $.fn.extend({
|
|
5261
5387
|
}
|
5262
5388
|
if ( nm != 'cb' && nm != 'subgrid' && nm != 'rn') {
|
5263
5389
|
svr[nm]=tmp;
|
5264
|
-
if(cm[i].editable===true
|
5390
|
+
if(cm[i].editable===true) {
|
5265
5391
|
if(focus===null) { focus = i; }
|
5266
5392
|
if (treeg) $("span:first",this).html("");
|
5267
5393
|
else $(this).html("");
|
5268
5394
|
var opt = $.extend({},cm[i].editoptions || {},{id:rowid+"_"+nm,name:nm});
|
5269
5395
|
if(!cm[i].edittype) { cm[i].edittype = "text"; }
|
5270
|
-
var elc = createEl(cm[i].edittype,opt,tmp
|
5396
|
+
var elc = createEl(cm[i].edittype,opt,tmp,true);
|
5271
5397
|
$(elc).addClass("editable");
|
5272
5398
|
if(treeg) $("span:first",this).append(elc);
|
5273
5399
|
else $(this).append(elc);
|
@@ -5307,47 +5433,47 @@ $.fn.extend({
|
|
5307
5433
|
editable = $(ind).attr("editable");
|
5308
5434
|
url = url ? url : $t.p.editurl;
|
5309
5435
|
if (editable==="1" && url) {
|
5436
|
+
var cm;
|
5310
5437
|
$("td",ind).each(function(i) {
|
5311
|
-
|
5312
|
-
|
5313
|
-
|
5314
|
-
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5321
|
-
|
5322
|
-
|
5323
|
-
|
5324
|
-
|
5325
|
-
|
5326
|
-
|
5327
|
-
|
5328
|
-
|
5329
|
-
|
5330
|
-
|
5331
|
-
|
5332
|
-
|
5333
|
-
|
5334
|
-
|
5335
|
-
|
5336
|
-
|
5337
|
-
|
5338
|
-
|
5339
|
-
|
5340
|
-
|
5341
|
-
|
5342
|
-
|
5343
|
-
|
5344
|
-
|
5345
|
-
|
5346
|
-
|
5347
|
-
|
5348
|
-
|
5349
|
-
|
5350
|
-
}
|
5438
|
+
cm = $t.p.colModel[i];
|
5439
|
+
nm = cm.name;
|
5440
|
+
if ( nm != 'cb' && nm != 'subgrid' && cm.editable===true && nm != 'rn') {
|
5441
|
+
switch (cm.edittype) {
|
5442
|
+
case "checkbox":
|
5443
|
+
var cbv = ["Yes","No"];
|
5444
|
+
if(cm.editoptions ) {
|
5445
|
+
cbv = cm.editoptions.value.split(":");
|
5446
|
+
}
|
5447
|
+
tmp[nm]= $("input",this).attr("checked") ? cbv[0] : cbv[1];
|
5448
|
+
break;
|
5449
|
+
case 'text':
|
5450
|
+
case 'password':
|
5451
|
+
case 'textarea':
|
5452
|
+
case "button" :
|
5453
|
+
tmp[nm]= !$t.p.autoencode ? $("input, textarea",this).val() : $.jgrid.htmlEncode($("input, textarea",this).val());
|
5454
|
+
break;
|
5455
|
+
case 'select':
|
5456
|
+
if(!cm.editoptions.multiple) {
|
5457
|
+
tmp[nm] = $("select>option:selected",this).val();
|
5458
|
+
tmp2[nm] = $("select>option:selected", this).text();
|
5459
|
+
} else {
|
5460
|
+
var sel = $("select",this), selectedText = [];
|
5461
|
+
tmp[nm] = $(sel).val();
|
5462
|
+
if(tmp[nm]) tmp[nm]= tmp[nm].join(","); else tmp[nm] ="";
|
5463
|
+
$("select > option:selected",this).each(
|
5464
|
+
function(i,selected){
|
5465
|
+
selectedText[i] = $(selected).text();
|
5466
|
+
}
|
5467
|
+
);
|
5468
|
+
tmp2[nm] = selectedText.join(",");
|
5469
|
+
}
|
5470
|
+
if(cm.formatter && cm.formatter == 'select') tmp2={};
|
5471
|
+
break;
|
5472
|
+
}
|
5473
|
+
cv = checkValues(tmp[nm],i,$t);
|
5474
|
+
if(cv[0] === false) {
|
5475
|
+
cv[1] = tmp[nm] + " " + cv[1];
|
5476
|
+
return false;
|
5351
5477
|
}
|
5352
5478
|
}
|
5353
5479
|
});
|
@@ -5368,7 +5494,7 @@ $.fn.extend({
|
|
5368
5494
|
var resp = $($t).setRowData(rowid,tmp);
|
5369
5495
|
$(ind).attr("editable","0");
|
5370
5496
|
for( var k=0;k<$t.p.savedRow.length;k++) {
|
5371
|
-
if( $t.p.savedRow[k].id
|
5497
|
+
if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
|
5372
5498
|
}
|
5373
5499
|
if(fr >= 0) { $t.p.savedRow.splice(fr,1); }
|
5374
5500
|
if( $.isFunction(aftersavefunc) ) { aftersavefunc(rowid,resp); }
|
@@ -5386,7 +5512,7 @@ $.fn.extend({
|
|
5386
5512
|
$($t).setRowData(rowid,tmp);
|
5387
5513
|
$(ind).attr("editable","0");
|
5388
5514
|
for( var k=0;k<$t.p.savedRow.length;k++) {
|
5389
|
-
if( $t.p.savedRow[k].id
|
5515
|
+
if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
|
5390
5516
|
};
|
5391
5517
|
if(fr >= 0) { $t.p.savedRow.splice(fr,1); }
|
5392
5518
|
if( $.isFunction(aftersavefunc) ) { aftersavefunc(rowid,res.responseText); }
|
@@ -5416,7 +5542,7 @@ $.fn.extend({
|
|
5416
5542
|
ind = $($t).getInd(rowid,true);
|
5417
5543
|
if(ind == false) {return;}
|
5418
5544
|
for( var k=0;k<$t.p.savedRow.length;k++) {
|
5419
|
-
if( $t.p.savedRow[k].id
|
5545
|
+
if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
|
5420
5546
|
}
|
5421
5547
|
if(fr >= 0) {
|
5422
5548
|
$($t).setRowData(rowid,$t.p.savedRow[fr]);
|
@@ -5528,7 +5654,8 @@ $.fn.extend({
|
|
5528
5654
|
closeicon: [true,"left","ui-icon-close"],
|
5529
5655
|
onClose : null,
|
5530
5656
|
colnameview : true,
|
5531
|
-
closeAfterSubmit : true
|
5657
|
+
closeAfterSubmit : true,
|
5658
|
+
updateAfterCheck : false
|
5532
5659
|
}, $.jgrid.col, p ||{});
|
5533
5660
|
return this.each(function(){
|
5534
5661
|
var $t = this;
|
@@ -5550,12 +5677,12 @@ $.fn.extend({
|
|
5550
5677
|
formdata += "<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";
|
5551
5678
|
for(i=0;i<this.p.colNames.length;i++){
|
5552
5679
|
if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
|
5553
|
-
formdata += "<tr><td style='white-space: pre'><input type='checkbox' id='col_" + this.p.colModel[i].name + "' class='cbox' value='T' " +
|
5680
|
+
formdata += "<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_" + this.p.colModel[i].name + "' class='cbox' value='T' " +
|
5554
5681
|
((this.p.colModel[i].hidden===false)?"checked":"") + "/>" + "<label for='col_" + this.p.colModel[i].name + "'>" + this.p.colNames[i] + ((p.colnameview) ? " (" + this.p.colModel[i].name + ")" : "" )+ "</label></td></tr>";
|
5555
5682
|
}
|
5556
5683
|
}
|
5557
5684
|
formdata += "</tbody></table></div>"
|
5558
|
-
var bS ="<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
|
5685
|
+
var bS = !p.updateAfterCheck ? "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>" : "",
|
5559
5686
|
bC ="<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
|
5560
5687
|
formdata += "<table border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+bS+" "+bC+"</td></tr></tbody></table>";
|
5561
5688
|
p.gbox = "#gbox_"+gID;
|
@@ -5568,26 +5695,43 @@ $.fn.extend({
|
|
5568
5695
|
$("#eData","#"+dtbl+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
|
5569
5696
|
.append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
|
5570
5697
|
}
|
5571
|
-
|
5572
|
-
|
5573
|
-
|
5574
|
-
|
5575
|
-
|
5576
|
-
$(
|
5577
|
-
|
5698
|
+
if(!p.updateAfterCheck) {
|
5699
|
+
$("#dData","#"+dtbl+"_2").click(function(e){
|
5700
|
+
for(i=0;i<$t.p.colModel.length;i++){
|
5701
|
+
if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
|
5702
|
+
var nm = $t.p.colModel[i].name.replace(".", "\\.");
|
5703
|
+
if($("#col_" + nm,"#"+dtbl).attr("checked")) {
|
5704
|
+
$($t).showCol($t.p.colModel[i].name);
|
5705
|
+
$("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG
|
5706
|
+
} else {
|
5707
|
+
$($t).hideCol($t.p.colModel[i].name);
|
5708
|
+
$("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG
|
5709
|
+
}
|
5710
|
+
}
|
5711
|
+
}
|
5712
|
+
if(p.ShrinkToFit===true) {
|
5713
|
+
$($t).setGridWidth($t.grid.width-0.001,true);
|
5714
|
+
}
|
5715
|
+
if(p.closeAfterSubmit) hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
|
5716
|
+
if (onAfterSubmit) { p.afterSubmitForm($("#"+dtbl)); }
|
5717
|
+
return false;
|
5718
|
+
});
|
5719
|
+
} else {
|
5720
|
+
$(":input","#"+dtbl).click(function(e){
|
5721
|
+
var cn = this.id.substr(4);
|
5722
|
+
if(cn){
|
5723
|
+
if(this.checked) {
|
5724
|
+
$($t).showCol(cn);
|
5578
5725
|
} else {
|
5579
|
-
$($t).hideCol(
|
5580
|
-
|
5726
|
+
$($t).hideCol(cn);
|
5727
|
+
}
|
5728
|
+
if(p.ShrinkToFit===true) {
|
5729
|
+
$($t).setGridWidth($t.grid.width-0.001,true);
|
5581
5730
|
}
|
5582
5731
|
}
|
5583
|
-
|
5584
|
-
|
5585
|
-
|
5586
|
-
}
|
5587
|
-
if(p.closeAfterSubmit) hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
|
5588
|
-
if (onAfterSubmit) { p.afterSubmitForm($("#"+dtbl)); }
|
5589
|
-
return false;
|
5590
|
-
});
|
5732
|
+
return this;
|
5733
|
+
});
|
5734
|
+
}
|
5591
5735
|
$("#eData", "#"+dtbl+"_2").click(function(e){
|
5592
5736
|
hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
|
5593
5737
|
return false;
|
@@ -5899,7 +6043,6 @@ $(selector).each(function() {
|
|
5899
6043
|
$('tbody > tr', $(this)).each(function() {
|
5900
6044
|
var row = {};
|
5901
6045
|
var rowPos = 0;
|
5902
|
-
data.push(row);
|
5903
6046
|
$('td', $(this)).each(function() {
|
5904
6047
|
if (rowPos == 0 && selectable) {
|
5905
6048
|
var input = $('input', $(this));
|
@@ -5914,6 +6057,7 @@ $(selector).each(function() {
|
|
5914
6057
|
}
|
5915
6058
|
rowPos++;
|
5916
6059
|
});
|
6060
|
+
if(rowPos >0) data.push(row);
|
5917
6061
|
});
|
5918
6062
|
|
5919
6063
|
// Clear the original HTML table
|
@@ -6497,15 +6641,15 @@ $.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)});
|
|
6497
6641
|
|
6498
6642
|
$.jqm = {
|
6499
6643
|
hash:{},
|
6500
|
-
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index')))
|
6501
|
-
if(c.modal) {if(!A[0])L('bind');A.push(s);}
|
6644
|
+
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index')));z=(z>0)?z:3000;var o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
|
6645
|
+
if(c.modal) {if(!A[0])setTimeout(function(){L('bind');},1);A.push(s);}
|
6502
6646
|
else if(c.overlay > 0) {if(c.closeoverlay) h.w.jqmAddClose(o);}
|
6503
6647
|
else o=F;
|
6504
6648
|
|
6505
6649
|
h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
|
6506
6650
|
if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
|
6507
6651
|
|
6508
|
-
if(c.ajax) {var r=c.target||h.w,u=c.ajax
|
6652
|
+
if(c.ajax) {var r=c.target||h.w,u=c.ajax;r=(typeof r == 'string')?$(r,h.w):$(r);u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
|
6509
6653
|
r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
|
6510
6654
|
else if(cc)h.w.jqmAddClose($(cc,h.w));
|
6511
6655
|
|
@@ -6519,8 +6663,7 @@ close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
|
|
6519
6663
|
},
|
6520
6664
|
params:{}};
|
6521
6665
|
var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
|
6522
|
-
i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
|
6523
|
-
e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
|
6666
|
+
e=function(h){var i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
|
6524
6667
|
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
|
6525
6668
|
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
|
6526
6669
|
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
|
@@ -6633,7 +6776,7 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
|
|
6633
6776
|
dayNames: opts.dayNames,
|
6634
6777
|
monthNames: opts.monthNames
|
6635
6778
|
};
|
6636
|
-
|
6779
|
+
if( format in opts.masks ) format = opts.masks[format];
|
6637
6780
|
date = date.split(/[\\\/:_;.\t\T\s-]/);
|
6638
6781
|
format = format.split(/[\\\/:_;.\t\T\s-]/);
|
6639
6782
|
// parsing for month names
|
@@ -6653,8 +6796,8 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
|
|
6653
6796
|
if (ty >= 70 && ty <= 99) ts.y = 1900+ts.y;
|
6654
6797
|
else if (ty >=0 && ty <=69) ts.y= 2000+ts.y;
|
6655
6798
|
timestamp = new Date(ts.y, ts.m, ts.d, ts.h, ts.i, ts.s,0);
|
6656
|
-
if( opts.masks
|
6657
|
-
newformat = opts.masks
|
6799
|
+
if( newformat in opts.masks ) {
|
6800
|
+
newformat = opts.masks[newformat];
|
6658
6801
|
} else if ( !newformat ) {
|
6659
6802
|
newformat = 'Y-m-d';
|
6660
6803
|
}
|
@@ -6756,7 +6899,7 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
|
|
6756
6899
|
}
|
6757
6900
|
};
|
6758
6901
|
$.fn.fmatter.showlink = function(cellval, opts) {
|
6759
|
-
var op = {baseLinkUrl: opts.baseLinkUrl,showAction:opts.showAction, addParam: opts.addParam, target: opts.target, idName: opts.idName },
|
6902
|
+
var op = {baseLinkUrl: opts.baseLinkUrl,showAction:opts.showAction, addParam: opts.addParam || "", target: opts.target, idName: opts.idName },
|
6760
6903
|
target = "";
|
6761
6904
|
if(!isUndefined(opts.colModel.formatoptions)) {
|
6762
6905
|
op = $.extend({},op,opts.colModel.formatoptions);
|
@@ -6814,46 +6957,42 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
|
|
6814
6957
|
};
|
6815
6958
|
$.fn.fmatter.select = function (cellval,opts, act) {
|
6816
6959
|
// jqGrid specific
|
6817
|
-
if(
|
6818
|
-
|
6819
|
-
|
6820
|
-
|
6821
|
-
|
6822
|
-
|
6823
|
-
|
6824
|
-
|
6825
|
-
|
6826
|
-
|
6827
|
-
|
6828
|
-
|
6829
|
-
|
6830
|
-
|
6831
|
-
|
6832
|
-
for(var i=0; i<so.length;i++){
|
6833
|
-
sv = so[i].split(":");
|
6834
|
-
if(msl) {
|
6835
|
-
if(jQuery.inArray(sv[0],scell)>-1) {
|
6836
|
-
ret[j] = sv[1];
|
6837
|
-
j++;
|
6838
|
-
}
|
6839
|
-
} else if($.trim(sv[0])==$.trim(cellval)) {
|
6840
|
-
ret[0] = sv[1];
|
6841
|
-
break;
|
6842
|
-
}
|
6843
|
-
}
|
6844
|
-
} else if(isObject(oSelect)) {
|
6845
|
-
// this is quicker
|
6960
|
+
if (!cellval) cellval = "";
|
6961
|
+
var oSelect = false;
|
6962
|
+
if(!isUndefined(opts.colModel.editoptions)){
|
6963
|
+
oSelect= opts.colModel.editoptions.value;
|
6964
|
+
}
|
6965
|
+
if (oSelect) {
|
6966
|
+
var ret = [],
|
6967
|
+
msl = opts.colModel.editoptions.multiple === true ? true : false,
|
6968
|
+
scell = [], sv;
|
6969
|
+
if(msl) { scell = cellval.split(","); scell = $.map(scell,function(n){return $.trim(n);})}
|
6970
|
+
if (isString(oSelect)) {
|
6971
|
+
// mybe here we can use some caching with care ????
|
6972
|
+
var so = oSelect.split(";"), j=0;
|
6973
|
+
for(var i=0; i<so.length;i++){
|
6974
|
+
sv = so[i].split(":");
|
6846
6975
|
if(msl) {
|
6847
|
-
|
6848
|
-
|
6849
|
-
|
6976
|
+
if(jQuery.inArray(sv[0],scell)>-1) {
|
6977
|
+
ret[j] = sv[1];
|
6978
|
+
j++;
|
6979
|
+
}
|
6980
|
+
} else if($.trim(sv[0])==$.trim(cellval)) {
|
6981
|
+
ret[0] = sv[1];
|
6982
|
+
break;
|
6850
6983
|
}
|
6984
|
+
}
|
6985
|
+
} else if(isObject(oSelect)) {
|
6986
|
+
// this is quicker
|
6987
|
+
if(msl) {
|
6988
|
+
ret = jQuery.map(scell, function(n, i){
|
6989
|
+
return oSelect[n];
|
6990
|
+
});
|
6991
|
+
} else {
|
6851
6992
|
ret[0] = oSelect[cellval] || "";
|
6852
6993
|
}
|
6853
|
-
return ret.join(", ");
|
6854
|
-
} else {
|
6855
|
-
return $.fn.fmatter.defaultFormat(cellval, opts);
|
6856
6994
|
}
|
6995
|
+
return ret.join(", ");
|
6857
6996
|
}
|
6858
6997
|
};
|
6859
6998
|
$.unformat = function (cellval,options,pos,cnt) {
|
@@ -6862,9 +7001,9 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
|
|
6862
7001
|
op =options.colModel.formatoptions || {},
|
6863
7002
|
unformatFunc = options.colModel.unformat||($.fn.fmatter[formatType] && $.fn.fmatter[formatType].unformat);
|
6864
7003
|
|
6865
|
-
if(unformatFunc !== 'undefined' && isFunction(unformatFunc) ) {
|
6866
|
-
ret = unformatFunc(cellval, options);
|
6867
|
-
} else if(formatType !== 'undefined' && isString(formatType) ) {
|
7004
|
+
if(typeof unformatFunc !== 'undefined' && isFunction(unformatFunc) ) {
|
7005
|
+
ret = unformatFunc($(cellval).text(), options);
|
7006
|
+
} else if(typeof formatType !== 'undefined' && isString(formatType) ) {
|
6868
7007
|
var opts = $.jgrid.formatter || {}, stripTag;
|
6869
7008
|
switch(formatType) {
|
6870
7009
|
/*
|
@@ -6893,6 +7032,9 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
|
|
6893
7032
|
var cbv = (options.colModel.editoptions) ? options.colModel.editoptions.value.split(":") : ["Yes","No"];
|
6894
7033
|
ret = $('input',cellval).attr("checked") ? cbv[0] : cbv[1];
|
6895
7034
|
break;
|
7035
|
+
case 'select' :
|
7036
|
+
ret = $.unformat.select(cellval,options,pos,cnt);
|
7037
|
+
break;
|
6896
7038
|
default:
|
6897
7039
|
ret= $(cellval).text();
|
6898
7040
|
break;
|
@@ -6900,6 +7042,50 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
|
|
6900
7042
|
}
|
6901
7043
|
return ret ? ret : cnt===true ? $(cellval).text() : $.jgrid.htmlDecode($(cellval).html());
|
6902
7044
|
};
|
7045
|
+
$.unformat.select = function (cellval,options,pos,cnt) {
|
7046
|
+
// Spacial case when we have local data and perform a sort
|
7047
|
+
// cnt is set to true only in sortDataArray
|
7048
|
+
var ret = [];
|
7049
|
+
var cell = $(cellval).text();
|
7050
|
+
if(cnt==true) return cell;
|
7051
|
+
var op = $.extend({},options.colModel.editoptions);
|
7052
|
+
if(op.value){
|
7053
|
+
var oSelect = op.value,
|
7054
|
+
msl = op.multiple === true ? true : false,
|
7055
|
+
scell = [], sv;
|
7056
|
+
if(msl) { scell = cell.split(","); scell = $.map(scell,function(n){return $.trim(n);})}
|
7057
|
+
if (isString(oSelect)) {
|
7058
|
+
var so = oSelect.split(";"), j=0;
|
7059
|
+
for(var i=0; i<so.length;i++){
|
7060
|
+
sv = so[i].split(":");
|
7061
|
+
if(msl) {
|
7062
|
+
if(jQuery.inArray(sv[1],scell)>-1) {
|
7063
|
+
ret[j] = sv[0];
|
7064
|
+
j++;
|
7065
|
+
}
|
7066
|
+
} else if($.trim(sv[1])==$.trim(cell)) {
|
7067
|
+
ret[0] = sv[0];
|
7068
|
+
break;
|
7069
|
+
}
|
7070
|
+
}
|
7071
|
+
} else if(isObject(oSelect)) {
|
7072
|
+
if(!msl) scell[0] = cell;
|
7073
|
+
ret = jQuery.map(scell, function(n){
|
7074
|
+
var rv;
|
7075
|
+
$.each(oSelect, function(i,val){
|
7076
|
+
if (val == n) {
|
7077
|
+
rv = i;
|
7078
|
+
return false;
|
7079
|
+
}
|
7080
|
+
});
|
7081
|
+
if( rv) return rv;
|
7082
|
+
});
|
7083
|
+
}
|
7084
|
+
return ret.join(", ");
|
7085
|
+
} else {
|
7086
|
+
return cell || "";
|
7087
|
+
}
|
7088
|
+
};
|
6903
7089
|
function fireFormatter(formatType,cellval, opts, rwd, act) {
|
6904
7090
|
formatType = formatType.toLowerCase();
|
6905
7091
|
var v=cellval;
|