я получил некоторый длинный текст, отображаемый в столбце сетки JQuery, как «1 2 3 4 5 6 7 8 9 10»JQuery положить перерыв в линии, которая находится вне экрана
После концов экрана «8» и не показывает «9 10»
есть ли способ поставить какой-то динамический разрыв там, поэтому было бы показать, как
1 2 3 4 5 6 7 8
9 10
Код:
@model PhonebookSB.Controllers.HomeController.getinform
<html style="height:100%">
<body lang="RU" style="height:100%" >
<style>
A {
color: #000;
}
html, body {
height: 95%;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function() {
infoName = '@Model.infoName';
$('#grid').jqGrid({
hidegrid: false,
url: "/Home/GetInfo/" + @Model.infoIdOut, page: 1,
datatype: 'json',
jsonReader: {
repeatitems: false
},
mtype: 'GET',
afterInsertRow: function (rowid, aData) {
},
colNames: ['infoid', infoName],
colModel: [
{ name: 'infoId', index: 'infoId', hidden: true, sortable: false },
{ name: 'infoText', align: 'left', sortable: false, hidden: false}
],
height: '100%',
rowNum: 1,
viewrecords: true,
subGridOptions: {
openicon: "ui-helper-hidden"
},
loadComplete: function() {
gridId = ("grid");
gridWidth = $('#gbox_' + gridId).parent().width();
gridHeight = $(window).innerHeight();
$('#' + gridId).jqGrid('setGridWidth', gridWidth);
$('#' + gridId).jqGrid('setGridHeight', gridHeight);
gridId = "tree";
gridHeight = $(window).innerHeight();
$('#' + gridId).jqGrid('setGridHeight', gridHeight);
}
});
$('#tree').jqGrid({
url: '/Home/infoTree/',
mtype: 'GET',
treeGrid: true,
treeGridModel: 'adjacency',
ExpandColumn: 'infoName',
ExpandColClick: true,
treedatatype: 'json',
datatype: 'json',
colNames: ['infoId', 'infoName'],
colModel: [
{ name: 'infoId', index: 'infoId', hidden: true, sortable: false },
{ name: 'infoName', index: 'infoName', hidden: false, sortable: false }
],
onSelectRow: function (ids) {
if (ids != null) {
data = jQuery('#tree').getRowData(ids);
jQuery("#grid").setGridParam({ url: "/Home/GetInfo/" + ids })
.trigger('reloadGrid');
}
},
caption: ''
});
$("#grid").jqGrid("hideCol", "subgrid");
gridId = "grid";
gridWidth = $('#gbox_' + gridId).parent().width();
$('#' + gridId).jqGrid('setGridWidth', gridWidth);
gridHeight = $(window).innerHeight();
$('#' + gridId).jqGrid('setGridHeight', gridHeight);
gridId = "tree";
gridWidth = $('#gbox_' + gridId).parent().width();
$('#' + gridId).jqGrid('setGridWidth', gridWidth);
gridHeight = $(window).innerHeight();
$('#' + gridId).jqGrid('setGridHeight', gridHeight);
$('#' + gridId).closest("div.ui-jqgrid-view")
.children("div.ui-jqgrid-hdiv")
.hide();
});
</script>
<div class="span3" style="font-size: 12.0pt">
<div class="specialtree" style="height:100%; width: 100%">
<table id="tree" style="height:100%; width: 100%"></table>
</div>
</div>
<div class="row-fluid">
<div class="span9">
<table id="grid" style="height:100%; width: 100%; word-break:break-all"></table>
</div></div>
</body>
</html>
Сделайте ширину таблицы равной ширине экрана (100%), а затем используйте слово break: break-word. – dfsq
Сделайте скрипку или поместите свой код здесь, это поможет нам в ответе, это может быть сделано css, но если вы поместите свой код или скрипку, тогда это станет более понятным. – bharatpatel
нет слома-паузы: брейк-слот, только брейк-слот, я пытался его использовать, но он все еще пытается разобрать все как одну строку, независимо от того, что для этого недостаточно места ... –