Я пытаюсь создать файл XML с использованием JSP, который будет использоваться для JQGrid.
файл JSP выглядит следующим образом: Пример.jsp: < /p>
< /code>
Когда я вызываю эту страницу с сервера, я вижу файл формата XML.
Однако, когда я называю ее из моего «example1.html» (который предоставленный пример с jqgrid, измененным для моих потребностей). Нет данных.
jqGrid Demo
html, body {
margin: 0; /* Remove body margin/padding */
padding: 0;
overflow: auto; /* Remove scroll bars on browser window */
font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
}
// We use a document ready jquery function.
jQuery(document).ready(function(){
jQuery("#list2").jqGrid({
// the url parameter tells from where to get the data from server
// adding ?nd='+new Date().getTime() prevent IE caching
url:'../js/example.jsp',
// datatype parameter defines the format of data returned from the server
// in this case we use a JSON data
datatype: "xml",
// colNames parameter is a array in which we describe the names
// in the columns. This is the text that appear in the head of the grid.
colNames:['Part Number', 'BOM', 'Database Ready', 'Config files Ready', 'HW Ready', 'SW Ready', 'OMNI Version', 'TCF Version', 'Default Cal File', 'Overall Status', 'Updated By', 'Update Date', 'Sign'],
// colModel array describes the model of the column.
// name is the name of the column,
// index is the name passed to the server to sort data
// note that we can pass here numbers too.
// width is the width of the column
// align is the align of the column (default is left)
// sortable defines if this column can be sorted (default true)
colModel:[
{name:'PartNumber',index:'PartNumber', width:55},
{name:'BOM',index:'BOM', width:90},
{name:'DatabaseReady',index:'DatabaseReady', width:100},
{name:'ConfigfilesReady',index:'ConfigfilesReady', width:80, align:"right"},
{name:'HWReady',index:'HWReady', width:80, align:"right"},
{name:'SWReady',index:'SWReady', width:80,align:"right"},
{name:'OMNIVersion',index:'OMNIVersion', width:150, sortable:false},
{name:'TCFVersion',index:'TCFVersion', width:55},
{name:'DefaultCalFile',index:'DefaultCalFile', width:90},
{name:'OverallStatus',index:'OverallStatus', width:100},
{name:'UpdatedBy',index:'UpdatedBy', width:80, align:"right"},
{name:'UpdateDate',index:'UpdateDate', width:80, align:"right"},
{name:'Sign',index:'Sign', width:80,align:"right"},
],
// pager parameter define that we want to use a pager bar
// in this case this must be a valid html element.
// note that the pager can have a position where you want
pager: jQuery('#pager2'),
// rowNum parameter describes how many records we want to
// view in the grid. We use this in example.php to return
// the needed data.
rowNum:10,
// rowList parameter construct a select box element in the pager
//in which we can change the number of the visible rows
rowList:[10,20,30],
// path to mage location needed for the grid
imgpath: 'themes/sand/images',
// sortname sets the initial sorting column. Can be a name or number.
// this parameter is added to the url
sortname: 'PartNumber',
//viewrecords defines the view the total records from the query in the pager
//bar. The related tag is: records in xml or json definitions.
viewrecords: true,
//sets the sorting order. Default is asc. This parameter is added to the url
sortorder: "asc",
caption: "Demo"
});
});
< /code>
Имейте в виду, что если я использую обычный XML -файл: "example.xml", он работает нормально < /p>
Заранее.
jqGrid Demo
html, body {
margin: 0; /* Remove body margin/padding */
padding: 0;
overflow: auto; /* Remove scroll bars on browser window */
font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
}
// We use a document ready jquery function.
jQuery(document).ready(function(){
jQuery("#list2").jqGrid({
colNames:['Part Number', 'BOM', 'Database Ready', 'Config files Ready'],
colModel:[
{name:'PartNumber',index:'PartNumber', width:55},
{name:'BOM',index:'BOM', width:90},
{name:'DatabaseReady',index:'DatabaseReady', width:100},
{name:'ConfigfilesReady',index:'ConfigfilesReady', width:180, align:"right"},
],
data: [
{ PartNumber: 'T562RL18B02.00', BOM: 'Ready', DatabaseReady: 'Ready', ConfigfilesReady: 'Not Ready' },
{ PartNumber: 'T562RL18B02.00', BOM: 'Ready', DatabaseReady: 'Ready', ConfigfilesReady: 'Not Ready' }
],
// pager parameter define that we want to use a pager bar
// in this case this must be a valid html element.
// note that the pager can have a position where you want
pager: jQuery('#pager2'),
// rowNum parameter describes how many records we want to
// view in the grid. We use this in example.php to return
// the needed data.
rowNum:10,
// rowList parameter construct a select box element in the pager
//in which we can change the number of the visible rows
rowList:[10,20,30],
// path to mage location needed for the grid
imgpath: 'themes/sand/images',
// sortname sets the initial sorting column. Can be a name or number.
// this parameter is added to the url
sortname: 'PartNumber',
//viewrecords defines the view the total records from the query in the pager
//bar. The related tag is: records in xml or json definitions.
viewrecords: true,
//sets the sorting order. Default is asc. This parameter is added to the url
sortorder: 'asc',
caption: 'Demo'
});
});
Подробнее здесь: https://stackoverflow.com/questions/373 ... for-jqgrid
Создание XML -файла с использованием JSP для JQGRID ⇐ Jquery
Программирование на jquery
-
Anonymous
1745620628
Anonymous
Я пытаюсь создать файл XML с использованием JSP, который будет использоваться для JQGrid.
файл JSP выглядит следующим образом: Пример.jsp: < /p>
< /code>
Когда я вызываю эту страницу с сервера, я вижу файл формата XML.
Однако, когда я называю ее из моего «example1.html» (который предоставленный пример с jqgrid, измененным для моих потребностей). Нет данных.
jqGrid Demo
html, body {
margin: 0; /* Remove body margin/padding */
padding: 0;
overflow: auto; /* Remove scroll bars on browser window */
font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
}
// We use a document ready jquery function.
jQuery(document).ready(function(){
jQuery("#list2").jqGrid({
// the url parameter tells from where to get the data from server
// adding ?nd='+new Date().getTime() prevent IE caching
url:'../js/example.jsp',
// datatype parameter defines the format of data returned from the server
// in this case we use a JSON data
datatype: "xml",
// colNames parameter is a array in which we describe the names
// in the columns. This is the text that appear in the head of the grid.
colNames:['Part Number', 'BOM', 'Database Ready', 'Config files Ready', 'HW Ready', 'SW Ready', 'OMNI Version', 'TCF Version', 'Default Cal File', 'Overall Status', 'Updated By', 'Update Date', 'Sign'],
// colModel array describes the model of the column.
// name is the name of the column,
// index is the name passed to the server to sort data
// note that we can pass here numbers too.
// width is the width of the column
// align is the align of the column (default is left)
// sortable defines if this column can be sorted (default true)
colModel:[
{name:'PartNumber',index:'PartNumber', width:55},
{name:'BOM',index:'BOM', width:90},
{name:'DatabaseReady',index:'DatabaseReady', width:100},
{name:'ConfigfilesReady',index:'ConfigfilesReady', width:80, align:"right"},
{name:'HWReady',index:'HWReady', width:80, align:"right"},
{name:'SWReady',index:'SWReady', width:80,align:"right"},
{name:'OMNIVersion',index:'OMNIVersion', width:150, sortable:false},
{name:'TCFVersion',index:'TCFVersion', width:55},
{name:'DefaultCalFile',index:'DefaultCalFile', width:90},
{name:'OverallStatus',index:'OverallStatus', width:100},
{name:'UpdatedBy',index:'UpdatedBy', width:80, align:"right"},
{name:'UpdateDate',index:'UpdateDate', width:80, align:"right"},
{name:'Sign',index:'Sign', width:80,align:"right"},
],
// pager parameter define that we want to use a pager bar
// in this case this must be a valid html element.
// note that the pager can have a position where you want
pager: jQuery('#pager2'),
// rowNum parameter describes how many records we want to
// view in the grid. We use this in example.php to return
// the needed data.
rowNum:10,
// rowList parameter construct a select box element in the pager
//in which we can change the number of the visible rows
rowList:[10,20,30],
// path to mage location needed for the grid
imgpath: 'themes/sand/images',
// sortname sets the initial sorting column. Can be a name or number.
// this parameter is added to the url
sortname: 'PartNumber',
//viewrecords defines the view the total records from the query in the pager
//bar. The related tag is: records in xml or json definitions.
viewrecords: true,
//sets the sorting order. Default is asc. This parameter is added to the url
sortorder: "asc",
caption: "Demo"
});
});
< /code>
Имейте в виду, что если я использую обычный XML -файл: "example.xml", он работает нормально < /p>
Заранее.
jqGrid Demo
html, body {
margin: 0; /* Remove body margin/padding */
padding: 0;
overflow: auto; /* Remove scroll bars on browser window */
font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
}
// We use a document ready jquery function.
jQuery(document).ready(function(){
jQuery("#list2").jqGrid({
colNames:['Part Number', 'BOM', 'Database Ready', 'Config files Ready'],
colModel:[
{name:'PartNumber',index:'PartNumber', width:55},
{name:'BOM',index:'BOM', width:90},
{name:'DatabaseReady',index:'DatabaseReady', width:100},
{name:'ConfigfilesReady',index:'ConfigfilesReady', width:180, align:"right"},
],
data: [
{ PartNumber: 'T562RL18B02.00', BOM: 'Ready', DatabaseReady: 'Ready', ConfigfilesReady: 'Not Ready' },
{ PartNumber: 'T562RL18B02.00', BOM: 'Ready', DatabaseReady: 'Ready', ConfigfilesReady: 'Not Ready' }
],
// pager parameter define that we want to use a pager bar
// in this case this must be a valid html element.
// note that the pager can have a position where you want
pager: jQuery('#pager2'),
// rowNum parameter describes how many records we want to
// view in the grid. We use this in example.php to return
// the needed data.
rowNum:10,
// rowList parameter construct a select box element in the pager
//in which we can change the number of the visible rows
rowList:[10,20,30],
// path to mage location needed for the grid
imgpath: 'themes/sand/images',
// sortname sets the initial sorting column. Can be a name or number.
// this parameter is added to the url
sortname: 'PartNumber',
//viewrecords defines the view the total records from the query in the pager
//bar. The related tag is: records in xml or json definitions.
viewrecords: true,
//sets the sorting order. Default is asc. This parameter is added to the url
sortorder: 'asc',
caption: 'Demo'
});
});
Подробнее здесь: [url]https://stackoverflow.com/questions/37398417/creating-an-xml-file-using-jsp-for-jqgrid[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия