展示

时间:2016-07-29 03:48:40

标签: datatable bootstrap-modal

The Bug is Chaining Shown Modal

所以,我有模态触发另一个模态并在之前解除模态。

这是第一个模态,当我点击按钮perusahaan或perorangan时,这个模态将解雇并调用另一个模态: enter image description here 但问题是,模态不能向下滚动。 enter image description here

所以,模态显示只有一半,当我向下滚动它不会滚动.. enter image description here

但是,如果我不使用链接模态,一切都很好 这是图片:enter image description here

以下是代码:

<!-- Modal Perusahaan -->
<div class="modal fade" id="Company" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header bg-info">
                <h6 class="modal-title text-white" id="myModalLabel"> Perusahaan </h6>
            </div>
            <div class="modal-body">
                <div class="form-group has-info">
                    <div class="table-responsive">
                        <table id="comTable"  class="table table-striped b-t b-b">
                            <thead>
                            <tr>
                                <th>Nama</th>
                                <th>Email</th>
                                <th>Telephon</th>
                                <th>Fax</th>
                                <th>Alamat</th>
                                <th>Deskripsi</th>
                            </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
                </form>
            </div>
        </div>
    </div>
</div>
<script>

$(document).ready(function () {
    $('#comTable').DataTable({
        serverSide : true,
        ajax : {
            url     : '{{ this.url.getBaseUri() }}customer/read',
            method  : 'POST'
        },
        columns: [
            {data: "comsName",
                render  : function( data, type, full, meta){
                    return   '<a class="btn btn-info col-md-12 animated pulse" data-dismiss="modal" onclick="document.getElementById(\'protComsId\').value=\''+full["comsId"]+'\'; ajaxProyek('+full["comsId"]+'); document.getElementById(\'unCompanyName\').innerHTML = \''+data+'\'; ">'+data+'</a>'
                }},
            {data: "comsEmail"},
            {data: "comsPhone"},
            {data: "comsFax"},
            {data: "comsAddress"},
            {data: "comsDesc"}
        ],
        order: [[ 1, "asc" ]]
    });
});
</script>

1 个答案:

答案 0 :(得分:0)

我加了延迟..

String FinalResult = "";
HttpWebRequest Request = (HttpWebRequest)System.Net.WebRequest.Create( URL );
HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();
Stream ResponseStream = Response.GetResponseStream();
StreamReader Reader = new StreamReader( ResponseStream );

bool NeedEncodingCheck = true;

while( true )
{
    string NewLine = Reader.ReadLine(); // it may not working for zipped HTML.
    if( NewLine == null )
    {
        break;
    }

    FinalResult += NewLine;
    FinalResult += Environment.NewLine;

    if( NeedEncodingCheck )
    {
        int Start = NewLine.IndexOf( "charset=" );
        if( Start > 0 )
        {
            Start += "charset=\"".Length;   
            int End = NewLine.IndexOfAny( new[] { ' ', '\"', ';' }, Start );

            Reader = new StreamReader( ResponseStream, Encoding.GetEncoding(
                NewLine.Substring( Start, End - Start ) ) ); // Replace Reader with new encoding.

            NeedEncodingCheck = false;
        }
    }
}

Reader.Close();
Response.Close();