admin

Forum Replies Created

Viewing 15 replies - 301 through 315 (of 635 total)
  • Author
    Replies
  • admin
    Keymaster

    I had to add this line in the setSelection method.

    ………………………………………………………………………………

    if( $(“#jqg_”+pt[ 0 ].id).attr(“disabled”) ){

    admin
    Keymaster

    is there any update to this???

    in reply to: Need to grey-out some boxes on multiselect #90096
    admin
    Keymaster

    found this by Arka Chatterjee on stackoverflow:

    Every checkbox has uniquie id which is combination of

    “jqg_”+rowid – where the rowid is the id of the row.

    You can use the following code to make it invisible

    $(“#jqg_Q391”)..css(“visibility”, “hidden”);

    in reply to: hOw to add extra fields to editRow form #90088
    admin
    Keymaster

    outofsight said:

    1) Id needs to be present in the edit form which it isnt, presumably as the field it not editable in the main grid


    Sorted, my bad. editable: true in the wrong place Embarassed

    This has of course left me with a few more questions.

    1)

    in reply to: tree grid help getting ancestor rowids? #90087
    admin
    Keymaster

    Thank you.

    tim

    in reply to: sending selected data as array to the PHP script #90086
    admin
    Keymaster

    the page isnt there

    admin
    Keymaster

    this topic solves my problem in my school project.. thank you very much. i wish someday i could be as good as you guys.

    in reply to: Sorting with Paging #90090
    admin
    Keymaster

    yeah it stayed at the current page but the data.. but it sorts all the data not the data within the selected page. is there any way to sort the data in the selected page?

    for instance i have an alphabet table:

    im in page 2 and the data in the table are-

    p

    s

    t

    r

    and i want to sort those data and it would be like:

    p

    r

    s

    t

    not like:

    a

    b

    c

    d

    or

    w

    x

    y

    z

    in reply to: JdGrid – Using PHP and MySQL database HELP Please. #90085
    admin
    Keymaster

    php file name: edit_user.php

    <?

    include('../connections/theConnection.php'); //connections
    $newid = $_POST['id']; //row id. this is the id of the selected row
    $uname = $_POST['uname']; //some variable
    $pass = md5($_POST['pass']);
    //some variable
    $email = $_POST['email'];
    //some variable
    $fname = $_POST['fname'];
    //some variable
    $mname = $_POST['mname'];
    //some variable
    $lname = $_POST['lname'];
    //some variable
    $cnumber = $_POST['cnumber'];
    //some variable
    $level = $_POST['level'];
    //some variable
    $operation = $_POST['oper'];
    //can be “add” “edit” “del”

    if ($operation == “edit”)
    {
    $result = mysql_query(“UPDATE user_tbl SET uname = '$uname', fname = '$fname', mname = '$mname', lname = '$lname', email = '$email', pass = '$pass', cnumber = '$cnumber', level = '$level' WHERE uid = '$newid'”);
    }

    else if ($operation == “add”) {
    $result = mysql_query(“INSERT INTO user_tbl(uname, fname, mname, lname, email, pass, cnumber, level, status) VALUES ('$uname', '$fname', '$mname', '$lname', '$email','$pass', '$cnumber','$level', 2)”);
    }
    else if($operation == “del”)
    {
    $result = mysql_query(“UPDATE user_tbl SET del = 2 WHERE uid = '$newid'”);
    }

    mysql_close($db);
    ?>

    the javascript required:

    jQuery(”#btn_add_edit”).click(function(){
    var gr = jQuery(”#my_jqgrid”).getGridParam('selrow');
    if( gr != null ) {
    jQuery(”#my_jqgrid”).editGridRow(gr,{height:280,reloadAfterSubmit:true});
    }
    else {
    jQuery(”#my_jqgrid”).editGridRow(”new”,{height:280,reloadAfterSubmit:true});
    }
    });

    the html required:

    SPAN { font-family: “Courier New”; font-size: 10pt; color: #000000; background: #FFFFFF; }A { text-decoration: none; font-weight: bold; color:#000000;}.S1 { color: #009300; background: #FFF7F7; }.S2 { color: #00008B; background: #FFF7F7; }<button type='submit' id='btn_add_edit'>ADD/EDIT

    ____________________________________________________________________________

    my simple

    in reply to: hOw to add extra fields to editRow form #90084
    admin
    Keymaster

    2) There might only be one id in the grid, but the user must be able to select from all of the id's in the foreign table, so I guess I need to do another lookup on the foreign table


    So I've found the docs on how to achieve point #2 but still struggling with #1

    I have colModel set as:

    name: 'resource_id',

    index: 'resource_id',

    hidden: true,

    edithidden: true,

    edittype: select,

    editoptions: { value: “1:Resource1;2:Resource2” },

    formoptions { editable: true}

    in reply to: custom unformat #90083
    admin
    Keymaster

    Hi Tony,

    I want to pass extra parameters to the server in addition to 'page','rows','sord','sidx'.

    Please specify what should I do.

    Regards,

    Kedar

    in reply to: hOw to add extra fields to editRow form #90079
    admin
    Keymaster

    I'll try to explain again in a little more detail as my previous response doenst actually cover everything.

    I have a grid that is generated from a table that for example looks like this (simplified a lot):

    id: Integer which is a foreign key

    name: varchar

    When I declare the grid, the id is not editable, I do not want it to be changed for any existing rows.

    When the user wants to add a new row I need to do two things…

    1) Id needs to be present in the edit form which it isnt, presumably as the field it not editable in the main grid

    2) There might only be one id in the grid, but the user must be able to select from all of the id's in the foreign table, so I guess I need to do another lookup on the foreign table?

    Im just not sure how to achieve this, I can't be the only person to have needed to do this so I am guessing it's possible but my lack of knowledge is the problem here.

    in reply to: Problem Adding text to navigation buttons #90076
    admin
    Keymaster

    Thx m8 that was very helpful

    in reply to: delGridRow on rowId ‘0’ fails … #90074
    admin
    Keymaster

    JaySab said:

    Hi,

    I am having

    admin
    Keymaster

    ah yes – you're correct.

    sorry…

    🙂

Viewing 15 replies - 301 through 315 (of 635 total)

Stay connected with us in your favorite flavor!