powered by simpleCommunicator - 2.0.59     © 2025 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Jqgrid не работает select
1 сообщений из 1, страница 1 из 1
Jqgrid не работает select
    #39405920
Wladimir74
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Доброго дня,
Начал изучение Jqgrid, все неплохо, но с этим встал в тупик.
Необходимо одному из полей в colmodel назначить тип "select". С подгружаемыми данными из бд. Поле становиться нужного типа, вот только данные в него не подгружаются. Грешил поначалу на неправильный формат файла который забирает данные из бд и отдает их полю. Прописал в "editoption" данные в виде строки. Тот же результат - select пуст. Уверен что проблема в мелочи, но никак не пойму в какой.
Буду безмерно рад Вашей помощи. Спасибо.
Вот мой jqgrid:

Код: html
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=cp1251" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Kor10</title>
 
<link rel="stylesheet" type="text/css" media="screen" href="css/ui-cupertino/jquery-ui.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<style>
html, body {
    margin: 0;
    padding: 0;
    font-size: 75%;
}
</style>
 
<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jqDnR.js"></script>
<script type="text/javascript" src="js/grid.common.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
 
</head>
<body>
<table id="ndvjmst"><tr><td></td></tr></table> 
<div id="pager_nd"></div> 
<script type="text/javascript">
$(function () {
	var lastSelection;
    $("#ndvjmst").jqGrid({
        url:'nd_get.php',
        datatype: "xml",
        mtype: "POST",
        colNames: ["id", "Номер", "Тип недвижимости","Право владения","Площадь"],
        colModel: [
            { name: "id", width: 55},
            { name: "nomer", width: 250, editable: true},
            { name: "type", index:"type", width: 200, editable: true, formatter: "select", edittype:"select",editoption: { value: "1:Квартира; 2:Офис; 3:машино-место" }},
	    { name: "pravo",  width: 80, editable: true},
	    { name: "plohad", width: 150, align: "right",editable: true},
        ],
        pager: "#pager_nd",
        rowNum: 10,
        rowList: [10, 20, 30],
        sortname: "id",
        sortorder: "desc",
        viewrecords: true,
        gridview: true,
        autoencode: true,
		editurl:'nd_set.php',
        caption: "Недвижимость - Кор10",
		        onCellSelect: function (rowid, iCol, cellContent, e) {
                        $("#ndvjmst").restoreRow(lastSelection);
                        $("#ndvjmst").editRow(rowid, true, null, null, null, null, null);
                        lastSelection = rowid;  
                      }
    }); 

		$('#ndvjmst').navGrid('#pager_nd',

			  {
				edit: true,
				add: true,
				del: true,
				search: false,
				refresh: false,
				view: false,
				position: "left",
				cloneToTop: false
			  },

			  {
				editCaption: "The Edit Dialog",
				recreateForm: true,
				checkOnUpdate: true,
				checkOnSubmit: true,
				closeAfterEdit: true,
				errorTextFormat: function(data) {
				  return 'Error: ' + data.responseText
				}

			  },
			  // options for the Add Dialog
			  {
				closeAfterAdd: true,
				recreateForm: true,
				errorTextFormat: function(data) {
				  return 'Error: ' + data.responseText
				}
			  },
			  // options for the Delete Dailog
			  {
				errorTextFormat: function(data) {
				  return 'Error: ' + data.responseText
				}
			  });
}); 
</script>
</body>
</html>
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Jqgrid не работает select
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]