jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts

  • okasha
    Participant

    thank you very much mr dimitar

    in reply to: date filter problem date filter problem #59820

    okasha
    Participant

    hello mr peter

    i have did the same as http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/filtering.htm?web

    but when i open the filter for date it doesnt says Show rows where date: and display normal textbox

    thank you
    okasha


    okasha
    Participant

    hello sir,

    i have implemented the code like the demo do and the insertion of new row is ok but when i enable virtual mode it insert blank row and i must refresh the page to see the row or update bound data

    i want to insert the row in virtual mode without having to call updatepounddata of the grid

    thank you

    in reply to: validator problem validator problem #58332

    okasha
    Participant

    hello Mr Dimitar

    may you tell me an example of building rules dinamically

    thank you
    okasha

    in reply to: rtl tree grid problem rtl tree grid problem #55819

    okasha
    Participant

    hello sir thank you for your reply

    here is my code

    $.ajax({
    dataType: 'json',
    url: js_base_url+'/backend/pages/get_tree_json',
    cache: false,
    success: function (pages_json) {
     var pages=pages_json; 
     alert ("pages");
     var source =
                {
                    dataType: "json",
                    dataFields: [
                        { name: 'page_code', type: 'number' },
                                            { name: 'page_parent', type: 'number' },
    
                        { name: 'page_title', type: 'string' }
                        
                    ],
                    hierarchy:
                    {
                        keyDataField: { name: 'page_code' },
                        parentDataField: { name: 'page_parent' }
                    },
                    id: 'page_code',
                    localData: pages
                };
                var dataAdapter = new $.jqx.dataAdapter(source);
      $("#treeGrid").jqxTreeGrid(
                {
                    width: 1080,
                    rtl:true,
                    source: dataAdapter,
                    sortable: true,
                    theme:site_theme,
                    ready: function()
                    {
                        $("#treeGrid").jqxTreeGrid('expandRow', '2');
                    },
                    columns: [
                      { text: 'كود الصفحة', dataField: 'page_code', width: 200, align: 'right', cellsAlign: 'right' },
                      { text: 'عنوان الصفحة', dataField: 'page_title', width: 200, align: 'right', cellsAlign: 'right' }
                    ]
                });
    },
    error: function(jqXHR, textStatus, errorThrown)
    {
    }
    });

    and i am using version 3.3
    best regards

    in reply to: the grid doesnt update the grid doesnt update #47247

    okasha
    Participant

    here is the whole code please check it if you dont mind and tell me your notes about it

    thank you in advance

    <!DOCTYPE html>
    <html lang=”en”>
    <head>
    <meta charset=”utf-8″>
    <title>المستخدمين</title>
    <link rel=”stylesheet” href=”<?= base_url(); ?>css/main.css” type=”text/css” />

    <link rel=”stylesheet” href=”<?= base_url(); ?>js/jqwidgets/styles/jqx.base.css” type=”text/css” />
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jquery-2.0.3.min.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/main.js”></script>

    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxcore.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxdata.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxbuttons.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxscrollbar.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxmenu.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxgrid.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxgrid.sort.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxgrid.filter.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxlistbox.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxcheckbox.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxwindow.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxinput.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxlistbox.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxdropdownlist.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxcombobox.js”></script>

    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxgrid.selection.js”></script>
    <script type=”text/javascript” src=”<?= base_url(); ?>js/jqwidgets/jqxgrid.pager.js”></script>

    <script type=”text/javascript” src=”<?= base_url(); ?>js/scripts/gettheme.js”></script>

    <script type=”text/javascript”>
    $(document).ready(function () {
    var theme = ‘classic’;
    var localizationobj = {};
    localizationobj.pagergotopagestring = “اذهب الى “;
    localizationobj.pagershowrowsstring = “عدد الصفوف بالصفحة”;
    localizationobj.pagerrangestring = ” of “;
    localizationobj.pagernextbuttonstring = “التالي”;
    localizationobj.pagerpreviousbuttonstring = “السابق”;
    localizationobj.sortascendingstring = “ترتيب تصاعدي”;
    localizationobj.sortdescendingstring = “ترتيب تنازلي”;
    localizationobj.sortremovestring = “ازالة الترتيب”;
    localizationobj.firstDay = 1;
    localizationobj.percentsymbol = “%”;
    localizationobj.currencysymbol = “€”;
    localizationobj.currencysymbolposition = “before”;
    localizationobj.decimalseparator = “.”;
    localizationobj.thousandsseparator = “,”;
    localizationobj.emptydatastring= “لاتوجد بيانات للعرض”;
    var days = {
    // full day names
    names: [“الاحد”, “الاثنين”, “الثلاثاء”, “الاربعاء”, “الخميس”, “الجمعة”, “السبت”],
    // abbreviated day names
    namesAbbr: [“الاحد”, “الاثنين”, “الثلاثاء”, “الاربعاء”, “الخميس”, “الجمعة”, “السبت”],
    // shortest day names
    namesShort: [“الاحد”, “الاثنين”, “الثلاثاء”, “الاربعاء”, “الخميس”, “الجمعة”, “السبت”]
    };
    localizationobj.days = days;
    var months = {
    // full month names (13 months for lunar calendards — 13th month should be “” if not lunar)
    names: [“يناير”, “فبراير”, “مارس”, “ابريل”, “مايو”, “يونيو”, “يوليو”, “اغسطس”, “سبتمبر”, “اكتوبر”, “نوفمبر”, “ديسمبر”, “”],
    // abbreviated month names
    namesAbbr: [“يناير”, “فبراير”, “مارس”, “ابريل”, “مايو”, “يونيو”, “يوليو”, “اغسطس”, “سبتمبر”, “اكتوبر”, “نوفمبر”, “ديسمبر”, “”]
    };
    localizationobj.months = months;
    // apply localization.

    $(“#user_f_name”).jqxInput({ width: ‘250px’, height: ’25px’});
    $(“#user_l_name”).jqxInput({ width: ‘250px’, height: ’25px’});
    $(“#user_name”).jqxInput({ width: ‘250px’, height: ’25px’});

    $(“#user_email”).jqxInput({ width: ‘250px’, height: ’25px’});

    $(“#user_password”).jqxInput({ width: ‘250px’, height: ’25px’});

    var user_roles=[{ “role_text”:”” , “role_value”:”” },{ “role_text”:”admin” , “role_value”:”1″ },{ “role_text”:”user” , “role_value”:”2″ }];
    $(“#user_role”).jqxComboBox({ selectedIndex: 0, source: user_roles, displayMember: “role_text”, valueMember: “role_value”, width: 200, height: 25});

    var user_status=[{ “status_text”:”” , “status_value”:”” },{ “status_text”:”un banned” , “status_value”:”1″ },{ “status_text”:”banned” , “status_value”:”2″ }];
    $(“#user_status”).jqxComboBox({ selectedIndex: 0, source: user_status, displayMember: “status_text”, valueMember: “status_value”, width: 200, height: 25});

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘user_code’ },
    { name: ‘user_name’ },
    { name: ‘user_email’ },
    { name: ‘user_f_name’ },
    { name: ‘user_l_name’ },
    { name: ‘user_role’ },
    { name: ‘user_status’ },
    { name: ‘تعديل’ }
    ],
    id: ‘user_code’,
    url: ‘http://localhost/portal/index.php/admin/users/display’,
    root: ‘Users’,
    beforeprocessing: function (data) {
    source.totalrecords = data[0].TotalRows;
    },
    updaterow: function (rowid, rowdata, commit) {

    var data=rowdata;
    $.ajax({
    type:”post”,
    dataType: ‘json’,
    url: ‘http://localhost/portal/index.php/admin/users/update’,
    data: data,
    success: function (data, status, xhr) {
    var selectedrowindex = $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’);

    $(‘#jqxgrid’).jqxGrid(‘unselectrow’, selectedrowindex);
    commit(true);
    },
    error: function () {
    var selectedrowindex = $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’);

    $(‘#jqxgrid’).jqxGrid(‘unselectrow’, selectedrowindex);
    commit(false);
    }
    });
    },
    addrow: function (rowid, rowdata, position, commit) {

    var data = rowdata;
    $.ajax({
    type:”post”,
    dataType: ‘json’,
    url: ‘http://localhost/portal/index.php/admin/users/add’,
    data: data,
    cache: false,
    success: function (inserted_code, status, xhr) {
    system_message(“تم اضافة المستخدم بنجاح”);

    rowdata.user_code=inserted_code;

    commit(true,rowdata.user_code);

    },
    error: function(jqXHR, textStatus, errorThrown)
    {
    commit(false);
    }
    });
    },
    deleterow: function (rowid, commit) {
    var data={};
    data[“selected_ids”] = rowid;
    $.ajax({
    type:”post”,

    dataType: ‘json’,
    url: ‘http://localhost/portal/index.php/admin/users/delete’,
    cache: false,
    data: data,
    success: function (data, status, xhr) {

    commit(true);

    },
    error: function (jqXHR, textStatus, errorThrown) {
    commit(false);
    }
    });
    }
    };
    var dataadapter = new $.jqx.dataAdapter(source);

    $(“#jqxgrid”).jqxGrid(
    {
    width: 1000,
    rtl:true,
    selectionmode: ‘checkbox’,
    source: dataadapter,
    theme: theme,
    autoheight: true,
    pageable: true,
    localization:localizationobj,
    virtualmode: true,
    rendergridrows: function () {
    return dataadapter.records;
    },
    columns: [
    { text: ‘كود المستخدم’, datafield: ‘user_code’, width: 100,cellsalign:’right’ },
    { text: ‘اسم المستخدم’, datafield: ‘user_name’, width: 100,cellsalign:’right’ },
    { text: ‘البريد الالكتروني’, datafield: ‘user_email’, width: 250,cellsalign:’right’ },

    { text: ‘الاسم الاول’, datafield: ‘user_f_name’, width: 100,cellsalign:’right’ },
    { text: ‘الاسم الاخير’, datafield: ‘user_l_name’, width: 100 ,cellsalign:’right’},
    { text: ‘الدور’, datafield: ‘user_role’, width: 100 ,cellsalign:’right’},
    { text: ‘الحالة’, datafield: ‘user_status’, width: 100 ,cellsalign:’right’},

    { text:’تعديل’,width:80,columntype:”button”, cellsrenderer: function () {
    return “تعديل”;
    }, buttonclick: function (row) {
    editrowindex = row;
    $(“#add_update_buttons”).html(‘ <input type=”button” value=”تحديث” id=”update_user” > <input type=”button” value=”الغاء” id=”cancel_update” >’);

    $(‘#jqxgrid’).jqxGrid(‘selectrow’, editrowindex);

    var id = $(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, “user_code”);

    $(‘#jqxwindow’).jqxWindow({rtl : true});
    $(“#jqxwindow”).jqxWindow({ width: 400, height: 300,rtl:true });

    $(‘#jqxwindow’).jqxWindow({ title: ‘تعديل بيانات مستخدم’ });

    $(“#cancel_update”).jqxButton({ width: ‘100’, height: ’25’});
    $(“#update_user”).jqxButton({ width: ‘100’, height: ’25’});

    $(“#user_code”).val($(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, “user_code”));

    $(“#user_f_name”).val($(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, “user_f_name”));
    $(“#user_l_name”).val($(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, “user_l_name”));
    $(“#user_name”).val($(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, “user_name”));

    $(“#user_email”).val($(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, “user_email”));
    $(“#user_role”).val($(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, “user_role”));
    $(“#user_status”).val($(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, “user_status”));

    $(‘#cancel_update’).on(‘click’, function () { $(‘#jqxgrid’).jqxGrid(‘unselectrow’, $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’));
    $(“#jqxwindow”).jqxWindow(“close”);
    });

    $(‘#update_user’).click( function () {
    var selectedrowindex = $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’);
    var id = $(“#jqxgrid”).jqxGrid(‘getrowid’, selectedrowindex);

    var rowdata={};
    rowdata[“user_code”]=$(“#user_code”).val();
    rowdata[“user_name”]=$(“#user_name”).val();
    rowdata[“user_email”]=$(“#user_email”).val();
    rowdata[“user_password”]=$(“#user_password”).val();
    rowdata[“user_f_name”]=$(“#user_f_name”).val();
    rowdata[“user_l_name”]=$(“#user_l_name”).val();
    rowdata[“user_role”]=$(“#user_role”).val();
    rowdata[“user_status”]=$(“#user_status”).val();

    $(“#jqxgrid”).jqxGrid(‘updaterow’, id, rowdata);

    $(“#jqxwindow”).jqxWindow(“close”);
    });

    $(“#jqxwindow”).jqxWindow(“show”);

    }}
    ]
    });

    $(“#add_new_user”).jqxButton({ width: ‘100’, height: ’25’});
    $(“#delete_selected”).jqxButton({ width: ‘100’, height: ’25’});

    $(‘#add_new_user’).click( function () {
    $(‘#jqxwindow’).jqxWindow({rtl : true});
    $(“#jqxwindow”).jqxWindow({ width: 400, height: 300,rtl:true });

    $(‘#jqxwindow’).jqxWindow({ title: ‘اضافة مستخدم جديد’ });

    $(“#user_code”).val(“”);

    $(“#user_f_name”).val(“”);
    $(“#user_l_name”).val(“”);
    $(“#user_name”).val(“”);

    $(“#user_email”).val(“”);
    $(“#user_password”).val(“”);
    $(“#user_role”).val(“”);
    $(“#user_status”).val(“”);

    var user_roles=[{ “role_text”:”admin” , “role_value”:”1″ },{ “role_text”:”user” , “role_value”:”2″ }];
    $(“#user_role”).jqxComboBox({ selectedIndex: 0, source: user_roles, displayMember: “role_text”, valueMember: “role_value”, width: 200, height: 25});

    var user_status=[{ “status_text”:”un banned” , “status_value”:”1″ },{ “status_text”:”banned” , “status_value”:”2″ }];
    $(“#user_status”).jqxComboBox({ selectedIndex: 0, source: user_status, displayMember: “status_text”, valueMember: “status_value”, width: 200, height: 25});

    $(“#add_update_buttons”).html(‘ <input type=”button” value=”اضافة مستخدم” id=”add_user” > <input type=”button” value=”الغاء” id=”cancel_add” >’);

    $(‘#cancel_add’).on(‘click’, function () {
    $(“#jqxwindow”).jqxWindow(“close”);
    });
    $(“#jqxwindow”).jqxWindow(“show”);

    $(‘#add_user’).click( function () {

    var rowdata={};

    rowdata[“user_name”]=$(“#user_name”).val();
    rowdata[“user_email”]=$(“#user_email”).val();
    rowdata[“user_password”]=$(“#user_password”).val();
    rowdata[“user_f_name”]=$(“#user_f_name”).val();
    rowdata[“user_l_name”]=$(“#user_l_name”).val();
    rowdata[“user_role”]=$(“#user_role”).val();
    rowdata[“user_status”]=$(“#user_status”).val();
    $(“#jqxgrid”).jqxGrid(‘addrow’,null, rowdata);
    $(“#jqxwindow”).jqxWindow(“close”);
    });

    });

    $(‘#delete_selected’).click( function () {

    var selected_indexes = $(‘#jqxgrid’).jqxGrid(‘getselectedrowindexes’);
    var rowscount = $(“#jqxgrid”).jqxGrid(‘getdatainformation’).rowscount;

    var selected_ids=new Array();
    //console.log(selected_indexes);
    jQuery.each(selected_indexes, function(index, value) {
    if (value >= 0 && value < rowscount) {
    selected_ids[index]=$(“#jqxgrid”).jqxGrid(‘getrowid’, value);

    }
    });

    // console.log(selected_ids);

    /* var selected_indexes = $(‘#jqxgrid’).jqxGrid(‘getselectedrowindexes’);
    var selected_ids=new Array();
    console.log(selected_indexes);
    jQuery.each(selected_indexes, function(index, value) {
    selected_ids[index]=$(“#jqxgrid”).jqxGrid(‘getrowid’, value);
    alert(selected_ids[index]);
    });*/
    //console.log (selected_ids);
    //var data={};
    //data[“selected_ids”]=selected_ids;

    $(“#jqxgrid”).jqxGrid(‘deleterow’,selected_ids );
    $(“#jqxgrid”).jqxGrid(‘clearselection’);
    });

    });

    </script>

    </head>
    <body style=”text-align: right;direction: rtl;” class=”default” >

    <div id=”system_message” ></div>

    <div id=”jqxgrid”></div>
    <input type=”button” value=”اضافة مستخدم” id=”add_new_user” >
    <input type=”button” value=”حذف المحدد” id=”delete_selected” >

    <div style=”display:none;” id=’jqxwindow’>
    <div id=”header”></div>
    <div style=”text-align: right;” id=”content”>

    <table width=”100%” border=”0″ dir=”rtl” style=”text-align: right;”>

    <tr>
    <td>الاسم الاول</td>
    <td><input type=”text” name=”user_f_name” id=”user_f_name” > </td>

    </tr>

    <tr>
    <td>الاسم الاخير</td>
    <td> <input type=”text” name=”user_l_name” id=”user_l_name” >
    </td>

    </tr>

    <tr>
    <td>اسم المستخدم</td>
    <td> <input type=”text” name=”user_name” id=”user_name” >
    </td>

    </tr>

    <tr>
    <td>البريد الالكتروني</td>
    <td> <input type=”text” name=”user_email” id=”user_email” >
    </td>

    </tr>

    <tr>
    <td>كلمة المرور</td>
    <td> <input type=”text” name=”user_password” id=”user_password” >
    </td>

    </tr>

    <tr>
    <td>نوع المستخدم</td>
    <td> <div id=”user_role”></div>
    </td>

    </tr>

    <tr>
    <td>حالة المستخدم</td>
    <td> <div id=”user_status”></div>
    </td>

    </tr>

    <tr>
    <td><input type=”hidden” name=”user_code” id=”user_code” > </td>
    <td id=”add_update_buttons” >

    </td>

    </tr>
    </table>

    </div>

    </div>

    </body>
    </html>

    in reply to: what is the problem what is the problem #46350

    okasha
    Participant

    can anyone help please

    in reply to: auto row height problem in ie auto row height problem in ie #16747

    okasha
    Participant

    sorry for disturbance it works now

    thank you

    in reply to: grid not working in IE 8 grid not working in IE 8 #16252

    okasha
    Participant

    Hi Mr Peter

    i added the data adapter in the change action of the #section_code combo box so that the data adapter is changed according to the selected section from the combo box and it is working in all browsers except IE

    please check it in IE and any other browser (eg firefox)

    thank you
    okasha

    in reply to: grid not working in IE 8 grid not working in IE 8 #16248

    okasha
    Participant

    Hello Mr Peter

    Please check the example and tell me where is the problem

    thank you
    okasha

    in reply to: grid not working in IE 8 grid not working in IE 8 #16214

    okasha
    Participant

    Hi mr peter
    here is a simple example of what i mean if you run it on IE it will not work

    http://www.risemyweb.com/demonstration.rar

    thank you
    okasha

    in reply to: grid not working in IE 8 grid not working in IE 8 #16091

    okasha
    Participant

    Hi mr peter
    here is the code

    $(document).ready(function () {

    var theme = jqwidgets_theme;
    var trackSource = {
    datatype: “json”,
    datafields: [
    {name: ‘value’},
    {name: ‘label’}
    ],
    id: ‘value’,
    url: base_url+’admin/videos/sectioncode’
    };
    var trackDataAdapter = new $.jqx.dataAdapter(trackSource);
    $(“#section_code”).jqxComboBox({
    width: 200,
    height: 25,
    selectedIndex: 0,
    source: trackDataAdapter,
    displayMember: ‘label’,
    valueMember: ‘value’
    });

    var trackSource2 = {
    datatype: “json”,
    datafields: [
    {name: ‘value’},
    {name: ‘label’}
    ],
    id: ‘value’,
    url: base_url+’admin/videos/searchfields’
    };
    var trackDataAdapter2 = new $.jqx.dataAdapter(trackSource2);
    $(“#search_field”).jqxComboBox({
    width: 200,
    height: 25,
    selectedIndex: 0,
    source: trackDataAdapter2,
    displayMember: ‘label’,
    valueMember: ‘value’
    });

    $(‘#search_videos’).bind(‘click’, function (event)
    {

    var section_code=$(“#section_code”).jqxComboBox(‘getSelectedItem’);
    section_code=section_code.value;
    var video_title=$(“#video_title”).val();
    var search_field=$(“#search_field”).jqxComboBox(‘getSelectedItem’);
    search_field=search_field.value;
    var source =
    {
    datatype: “json”,
    datafields: [
    {name: ‘video_code’},
    {name: ‘section_title’},
    {name: ‘section_code’},
    {name: ‘video_title_ar’},
    {name: ‘video_title_en’},
    {name: ‘youtube_code’}

    ],data: {
    section_code: section_code,
    search_field: search_field,
    video_title: video_title

    },
    url: base_url+’admin/videos/section’,
    id:”video_code”,
    addrow: function (rowid, rowdata, position, commit) {
    var data = “insert=true&” + $.param(rowdata);
    $.ajax({
    dataType: ‘json’,
    type:”post”,
    url: base_url+’admin/videos/section’,
    data: data,
    cache: false,
    success: function (data, status, xhr) {
    rowdata[“video_code”]=data;

    commit(true);
    },
    error: function (jqXHR, textStatus, errorThrown) {
    commit(false);
    }
    });
    },

    updaterow: function (rowid, rowdata, commit) {
    // synchronize with the server – send update command
    var data = “update=true&” + $.param(rowdata);
    $.ajax({
    dataType: ‘json’,
    type:’post’,
    url: base_url+’admin/videos/section’,
    cache: false,
    data: data,
    success: function (data, status, xhr) {
    // update command is executed.
    commit(true);
    },
    error: function (jqXHR, textStatus, errorThrown) {
    commit(false);
    }
    });
    },

    deleterow: function (rowid, commit) {
    var data = “delete=true&video_code=” + rowid;
    $.ajax({
    dataType: ‘json’,
    type:”post”,
    url: base_url+’admin/videos/section’,
    cache: false,
    data: data,
    success: function (data, status, xhr) {
    commit(true);

    },
    error: function (jqXHR, textStatus, errorThrown) {

    }
    });
    },
    root: ‘videosection’,
    beforeprocessing: function (data) {
    source.totalrecords = data.videosection_count;
    }
    };

    dataadapter = new $.jqx.dataAdapter(source);

    $(“#jqxgrid”).jqxGrid({source: dataadapter});

    });

    $(“#section_code”).on(‘bindingComplete’, function (event) {
    $(‘#search_videos’).trigger(‘click’);
    });

    $(“#jqxgrid”).jqxGrid(
    {
    width: 1190,

    theme: theme,
    autoheight: true,
    autorowheight:true,
    pageable: true,
    virtualmode: true,
    rendergridrows: function () {
    return dataadapter.records;
    },
    columns: [
    {text: video_delete,datafield:’Delete’, columntype: ‘button’,width:100, cellsrenderer: function () {
    return video_delete;
    }, buttonclick: function (row) {

    ensure_deletion_action=confirm(ensure_deletion);

    if(ensure_deletion_action==true){

    var selectedrowindex = $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’);

    //var id = $(“#jqxgrid”).jqxGrid(‘getrowid’, selectedrowindex);
    alert($(‘#jqxgrid’).jqxGrid(‘getrowid’, selectedrowindex));
    $(“#jqxgrid”).jqxGrid(‘deleterow’, $(‘#jqxgrid’).jqxGrid(‘getrowid’, selectedrowindex));
    //alert(delete_result);
    //if(delete_result==true){
    system_message(video_deleted);
    //}

    }

    }},
    {text: video_edit, datafield: ‘Edit’,width:100, columntype: ‘button’, cellsrenderer: function () {
    return video_edit;
    }, buttonclick: function (row) {

    editrow = row;
    var offset = $(“#jqxgrid”).offset();
    $(“#popupWindow”).jqxWindow({position: {x: parseInt(offset.left) + 360, y: parseInt(offset.top) + 60},width:510,height:230});

    var dataRecord = $(“#jqxgrid”).jqxGrid(‘getrowdata’, editrow);
    $(“#video_code”).val(dataRecord.video_code);
    $(“#video_title_ar”).val(dataRecord.video_title_ar);
    $(“#video_title_en”).val(dataRecord.video_title_en);
    $(“#youtube_code”).val(dataRecord.youtube_code);
    alert(dataRecord.section_code);
    $(“#video_section_code”).jqxComboBox(“selectItem”,$(“#video_section_code”).jqxComboBox(‘getItemByValue’, dataRecord.section_code ) );
    //alert(dataRecord.section_code);

    $(“#video_form_submit”).html(”+edit_video+”);
    $(“#update_video”).jqxButton({theme: theme});

    $(“#video_form_title”).html(edit_video_data);

    $(“#popupWindow”).jqxWindow(‘show’);
    }
    },
    {text: youtube_code, datafield: ‘youtube_code’,width:300,cellsalign:’right’,align:’right’},
    {text: video_title_en, datafield: ‘video_title_en’,width:245,cellsalign:’right’,align:’right’},
    {text: video_title_ar, datafield: ‘video_title_ar’,width:245,cellsalign:’right’,align:’right’},
    {text: video_section, datafield: ‘section_title’,width:100,cellsalign:’right’,align:’right’},

    {text: video_code, datafield: ‘video_code’,width:100,cellsalign:’right’,align:’right’}
    ]
    });

    $(“#jqxgrid”).jqxGrid(‘localizestrings’, localizationobj);

    $(“#update_video”).live(“click”,function(){
    var row = {};
    var check = $(‘#video’).jqxValidator(‘validate’);
    if (check == true) {

    row[“video_code”]=$(“#video_code”).val();
    row[“video_title_ar”]=$(“#video_title_ar”).val();
    row[“video_title_en”]=$(“#video_title_en”).val();
    row[“youtube_code”]=$(“#youtube_code”).val();
    var item = $(“#video_section_code”).jqxComboBox(‘getItem’, $(“#video_section_code”).jqxComboBox(‘getSelectedIndex’) );
    row[“section_code”]=item.value;
    row[“section_title”]=item.label;
    var selectedrowindex = $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’);

    var id = $(“#jqxgrid”).jqxGrid(‘getrowid’, selectedrowindex);
    update_result= $(“#jqxgrid”).jqxGrid(‘updaterow’, id, row);
    if(update_result==true){
    system_message(section_updated);
    }
    $(“#popupWindow”).jqxWindow(‘hide’);
    }
    });

    $(“#search_videos”).jqxButton({theme: theme});

    $(“#add_video_button”).jqxButton({theme: theme});

    $(“#add_video_button”).click(function(){
    $(window).scrollTop(0);
    var offset = $(“#jqxgrid”).offset();
    $(“#popupWindow”).jqxWindow({position: {x: parseInt(offset.left) + 360, y: parseInt(offset.top) + 60},width:510,height:230,animationType: ‘combined’,isModal: true});
    //$(‘#popupWindow’).jqxWindow(‘bringToFront’);

    $(“#video_code”).val(“”);
    $(“#video_title_ar”).val(“”);
    $(“#video_title_en”).val(“”);
    $(“#youtube_code”).val(“”);

    $(“#video_section_code”).jqxComboBox(“selectIndex”, 0);

    //$(“#video_section_code”).jqxComboBox(‘removeAt’, 0 );
    $(“#video_form_submit”).html(”);

    $(“#add_video”).jqxButton({theme: theme});

    $(“#video_form_title”).html(add_video);
    //console.log(dataRecord);

    $(“#popupWindow”).jqxWindow(‘show’);
    }) ;

    var trackSource = {
    datatype: “json”,
    datafields: [
    {name: ‘value’},
    {name: ‘label’}
    ],
    id: ‘value’,
    url: base_url+’admin/videos/sectioncode’
    };
    var trackDataAdapter = new $.jqx.dataAdapter(trackSource);
    $(“#video_section_code”).jqxComboBox({
    width: 200,
    height: 25,
    selectedIndex: 0,
    source: trackDataAdapter,
    displayMember: ‘label’,
    valueMember: ‘value’
    });

    $(“#add_video”).live(“click”,function(){
    var row = {};
    var check = $(‘#video’).jqxValidator(‘validate’);
    //row[“user_code”]=$(“#user_code”).val();
    if (check == true) {
    //alert(“will insert”);
    //var last_video_code=parseInt( $(“#last_video_code”).val())+1;
    row[“video_title_ar”]=$(“#video_title_ar”).val();
    row[“video_title_en”] = $(“#video_title_en”).val();
    row[“youtube_code”]=$(“#youtube_code”).val();
    var item = $(“#video_section_code”).jqxComboBox(‘getItem’, $(“#video_section_code”).jqxComboBox(‘getSelectedIndex’) );
    row[“section_code”]=item.value;
    row[“section_title”]=item.label;
    //var selectedrowindex = $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’);
    //alert(item.value);
    //var id = $(“#jqxgrid”).jqxGrid(‘getrowid’, selectedrowindex);
    //alert(id);
    //console.log(row);
    insert_result= $(“#jqxgrid”).jqxGrid(‘addrow’, null,row);
    //alert(insert_result);
    if(insert_result==true){
    system_message(video_added);
    }
    $(“#video #last_video_code”).attr(“value”, last_video_code);
    //$(‘#jqxgrid’).jqxGrid(‘updatebounddata’);
    $(“#popupWindow”).jqxWindow(‘hide’);
    }
    //console.log(row);
    });

    $(“#video”).jqxValidator({
    rules: [
    {input: ‘#youtube_code’, message: v_youtube_code, action: ‘keyup, blur’, rule: ‘required’},
    {input: ‘#video_title_ar’, message: v_video_title_ar, action: ‘keyup, blur’, rule: ‘required’},
    {input: ‘#video_title_en’, message: v_video_title_en, action: ‘keyup, blur’, rule: ‘required’},
    {input: ‘#video_section_code’, message: v_section_code, action: ‘select’, rule: function(){
    if($(“#video_section_code”).jqxComboBox(“getSelectedIndex”)==0){
    return false;
    }
    return true;

    }}

    ]
    });

    });

    this problem occur only in ie

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; BTRS105855; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C)
    Timestamp: Thu, 28 Feb 2013 16:10:54 UTC

    Message: ‘this._pageviews.0’ is null or not an object
    Line: 7
    Char: 56050
    Code: 0
    URI: http://localhost/portal/public/js/jqwidgets/jqxgrid.js

    Message: ‘value’ is null or not an object
    Line: 51
    Char: 5
    Code: 0
    URI: http://localhost/portal/public/js/admin/videos/section.js

    thank you

    in reply to: the request is sent twice the request is sent twice #14858

    okasha
    Participant

    thank you very much mr peter it is working now

    in reply to: the request is sent twice the request is sent twice #14543

    okasha
    Participant

    hello Mr peter

    the change event is executed when the page is loaded the problem is when i update the dataadapter variable inside the function it doesn’t updated outside the function although it is global variable

    i am sorry i know that i have disturbed you so much but i really need to solve it

    thank you

    in reply to: the request is sent twice the request is sent twice #14541

    okasha
    Participant

    hello mr peter

    i have modified my code to be like that and it is not working (firebug says:TypeError: f.source is undefined)
    may you tell me where is the error

    var dataadapter;
    var theme =jqwidgets_theme;
    var trackSource = {
    datatype: “json”,
    datafields: [
    {name: ‘value’},
    {name: ‘label’}
    ],
    id: ‘value’,
    url: base_url+’admin/pages/pagescodelevel’
    };
    var trackDataAdapter = new $.jqx.dataAdapter(trackSource);
    $(“#page_code_level”).jqxComboBox({
    width: 200,
    height: 25,
    selectedIndex: 0,
    source: trackDataAdapter,
    displayMember: ‘label’,
    valueMember: ‘value’
    });
    $(‘#page_code_level’).bind(‘change’, function (event)
    {
    //console.log(event);
    //console.log(“select”);
    //a=20;

    var page_code_level_selected=$(“#page_code_level”).jqxComboBox(‘getSelectedItem’);
    selected_value=page_code_level_selected.value;
    //alert(selected_value);
    var source =
    {
    datatype: “json”,
    datafields: [
    {name: ‘page_code’},
    {name: ‘page_title’},
    {name: ‘page_created’},
    {name: ‘page_modified’},
    {name: ‘page_order’}

    ],data: {
    show_childs_of: selected_value

    },
    url: base_url+’admin/pages/list’,
    id:”page_code”,
    addrow: function (rowid, rowdata, position, commit) {
    var data = “insert=true&” + $.param(rowdata);
    $.ajax({
    dataType: ‘json’,
    url: base_url+’admin/pages/list’,
    type:”post”,
    data: data,
    cache: false,
    success: function (data, status, xhr) {

    commit(true);
    },
    error: function (jqXHR, textStatus, errorThrown) {
    commit(false);
    }
    });
    },

    updaterow: function (rowid, rowdata, commit) {
    var data = “update=true&” + $.param(rowdata);
    $.ajax({
    dataType: ‘json’,
    url: base_url+’admin/pages/list’,
    type:”post”,
    cache: false,
    data: data,
    success: function (data, status, xhr) {
    commit(true);
    },
    error: function (jqXHR, textStatus, errorThrown) {
    commit(false);
    }
    });
    },
    root: ‘pages’,
    beforeprocessing: function (data) {
    //selected_value= 5;

    source.totalrecords = data.pages_count;

    }
    };

    dataadapter = new $.jqx.dataAdapter(source);

    });

    $(“#jqxgrid”).jqxGrid(
    {
    width: 1190,
    source: dataadapter,
    theme: jqwidgets_theme,
    autoheight: true,
    pageable: true,
    virtualmode: true,
    rendergridrows: function () {

    return dataadapter.records;
    },
    columns: [

    {text: ‘حذف’, columntype: ‘button’,width:60},
    {text: ‘تعديل’, datafield: ‘Edit’, columntype: ‘button’, cellsrenderer: function () {
    return “تعديل”;
    }, buttonclick: function (row) {
    $(“#page_form_order”).html(‘ترتيب الصفحة ‘);

    editrow = row;
    //alert(editrow);
    var offset = $(“#jqxgrid”).offset();
    if(CKEDITOR.instances.page_content){
    CKEDITOR.instances.page_content.destroy();
    }

    CKEDITOR.replace(‘page_content’);
    $(“#popupWindow”).jqxWindow({position: {x: parseInt(offset.left) + 200, y: parseInt(offset.top)},width:1000,height:2000});

    var dataRecord = $(“#jqxgrid”).jqxGrid(‘getrowdata’, editrow);
    $(“#page_code”).val(dataRecord.page_code);
    $(“#page_title”).val(dataRecord.page_title);
    $(“#page_order”).val(dataRecord.page_order);

    CKEDITOR.instances.page_content.setData(”);

    var data={“page_code”:dataRecord.page_code,”update”:true};
    $.ajax({
    dataType: ‘json’,
    url: base_url+’admin/pages/tree’,
    type:”post”,
    cache: false,
    data: data,
    success: function (data, status, xhr) {
    CKEDITOR.instances.page_content.setData(data.content);
    $(‘#jqxTree’).jqxTree(‘destroy’);
    $(“#dropDownButton”).jqxDropDownButton(‘destroy’);
    $(“#drop_down_td”).html(‘

    ‘);
    $(“#dropDownButton”).html(‘

    ‘);
    $(“#jqxTree”).html(data.tree);
    $(“#dropDownButton”).jqxDropDownButton({width: 150, height: 25, theme: theme});
    $(‘#jqxTree’).bind(‘select’, function (event) {
    var args = event.args;
    var item = $(‘#jqxTree’).jqxTree(‘getItem’, args.element);
    var dropDownContent = ‘

    ‘ + item.label + ‘

    ‘;
    $(“#dropDownButton”).jqxDropDownButton(‘setContent’, dropDownContent);
    });

    $(“#jqxTree”).jqxTree({width: 200, theme: jqwidgets_theme});

    },
    error: function (jqXHR, textStatus, errorThrown) {
    commit(false);
    }
    });

    $(“#page_form_submit”).html(‘تعديل الصفحة’);
    $(“#user_form_title”).html(“تعديل بيانات صفحة”);

    $(“#popupWindow”).jqxWindow(‘show’);
    }
    },
    {text: ‘الترتيب’, datafield: ‘page_order’},

    {text: ‘اخر تعديل’, datafield: ‘page_modified’, cellsrenderer: modifiedrenderer},
    {text: ‘تاريخ الاضافة’, datafield: ‘page_created’, cellsrenderer: createdrenderer},
    {text: ‘عنوان الصفحة’, datafield: ‘page_title’},
    {text: ‘كود الصفحة’, datafield: ‘page_code’}
    ]
    });

    thank you
    okasha

Viewing 15 posts - 1 through 15 (of 22 total)