Flexigrid实现css动态变化
当我在 Flexigrid 表中执行某些操作时,我在更改 Flexigrid 表中一行的背景颜色时遇到问题。
我有这样定义的表:
$(document).ready(function() {
$("#newTable").flexigrid({
url: 'agendaTipoAppuntamentoInitJson.do',
dataType: 'json',
colModel : [
{display: 'ID', name : 'idTipoAppuntamento', width : 40, sortable : false, align: 'center', hide: true},
{display: 'Codice', name : 'codice', width : 60, sortable : false, align: 'left'},
{display: 'Descrizione', name : 'descrizione', width : 130, sortable : false, align: 'left'},
{display: 'Descr. breve', name : 'descrBreve', width : 80, sortable : false, align: 'left'},
{display: 'Colore', name : 'colore', width : 80, sortable : false, align: 'left'},
{display: 'ID Struttura', name : 'idStruttura', width : 60, sortable : false, align: 'left', hide: true},
{display: 'Descr. Struttura', name : 'descrizioneStruttura', width : 150, sortable : false, align: 'left'},
{display: 'ID Spec', name : 'idSpecializzazione', width : 60, sortable : false, align: 'left', hide: true},
{display: 'Descr. Spec', name : 'descrizioneSpecializzazione', width : 150, sortable : false, align: 'left'}
],
usepager: true,
title: 'Gestione tipi appuntamento',
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 950,
height: 370,
singleSelect: true,
click: editMe
});
});
并且有 JQuery 对话框:
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#newDialog-form" ).dialog({
open : function(event, ui) {
originalContent = $("#newDialog-form").html();
$('#coloreIns').simpleColorPicker({ showEffect: 'fade', hideEffect: 'slide' });
},
close : function(event, ui) {
$("#newDialog-form").html(originalContent);
},
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
Salva: function() {
$.ajax({
url: 'agendaTipoAppuntamentoSaveJson.do',
type: "POST",
dataType: "json",
data: $("#newDialogForm").serialize(),
success: function(result) {
if (result.esito!='OK') {
alert(result.esito + ' ' + result.message);
}
else {
$("#newTable").flexReload();
$( "#newDialog-form" ).dialog( 'close' );
}
},
error:function (xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(thrownError);
}
});
},
Annula : function() {
$( this ).dialog( "close" );
}
}});
$( "#newDialog-form" ).dialog({ closeText: '' });
});
我需要一些 JavaSript 函数来更改在对话框中使用 Salva 函数插入的行的 css。
不明白如何在 Flexigrid 中执行此操作。
i have problem with implementation of change background color of one row in Flexigrid table when I do some action in that table.
I have table defined like this:
$(document).ready(function() {
$("#newTable").flexigrid({
url: 'agendaTipoAppuntamentoInitJson.do',
dataType: 'json',
colModel : [
{display: 'ID', name : 'idTipoAppuntamento', width : 40, sortable : false, align: 'center', hide: true},
{display: 'Codice', name : 'codice', width : 60, sortable : false, align: 'left'},
{display: 'Descrizione', name : 'descrizione', width : 130, sortable : false, align: 'left'},
{display: 'Descr. breve', name : 'descrBreve', width : 80, sortable : false, align: 'left'},
{display: 'Colore', name : 'colore', width : 80, sortable : false, align: 'left'},
{display: 'ID Struttura', name : 'idStruttura', width : 60, sortable : false, align: 'left', hide: true},
{display: 'Descr. Struttura', name : 'descrizioneStruttura', width : 150, sortable : false, align: 'left'},
{display: 'ID Spec', name : 'idSpecializzazione', width : 60, sortable : false, align: 'left', hide: true},
{display: 'Descr. Spec', name : 'descrizioneSpecializzazione', width : 150, sortable : false, align: 'left'}
],
usepager: true,
title: 'Gestione tipi appuntamento',
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 950,
height: 370,
singleSelect: true,
click: editMe
});
});
and have JQuery dialog:
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#newDialog-form" ).dialog({
open : function(event, ui) {
originalContent = $("#newDialog-form").html();
$('#coloreIns').simpleColorPicker({ showEffect: 'fade', hideEffect: 'slide' });
},
close : function(event, ui) {
$("#newDialog-form").html(originalContent);
},
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
Salva: function() {
$.ajax({
url: 'agendaTipoAppuntamentoSaveJson.do',
type: "POST",
dataType: "json",
data: $("#newDialogForm").serialize(),
success: function(result) {
if (result.esito!='OK') {
alert(result.esito + ' ' + result.message);
}
else {
$("#newTable").flexReload();
$( "#newDialog-form" ).dialog( 'close' );
}
},
error:function (xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(thrownError);
}
});
},
Annula : function() {
$( this ).dialog( "close" );
}
}});
$( "#newDialog-form" ).dialog({ closeText: '' });
});
I need some JavaSript function to channge css of row that is inserted with Salva function in dialog box.
Don't understand how to do it in Flexigrid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论