jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • in reply to: Autocomplete Font Color Autocomplete Font Color #64983

    C.S.Putera
    Participant

    Thank you for your response. I’ve tried adding the css :

    
    <style>
            .jqx-widget-content {
                color: red;
            }
    </style>
    

    It changes the font ‘within’ the jqwidgets field, but when I populate the options from the autocomplete, the options still in blue color. What I want to achieve is to set the color of the fonts in the options to black. Any other way to achieve that ? Thank you.


    C.S.Putera
    Participant

    I found the reason. It is due to the same variable name that I use to identify the grid, both uses var grid, so it conflicts when I call the others. This is not jqwidgets but my mistake. Tq


    C.S.Putera
    Participant

    This is how I initialize the grid :

    
    if(options.filterable) {
    	data.filter = function() {
    		$("#'.$this->selector.'").jqxGrid("updatebounddata", "filter");
    	}
    }
    
    if(options.sortable) {
    	data.sort = function() {
    		$("#'.$this->selector.'").jqxGrid("updatebounddata", "sort");
    	}
    }
    
    if(typeof data.beforeprocessing == "undefined") {
    	data.beforeprocessing = function(record) {
    		if(record) data.totalrecords = record.totalRows;
    	}
    }
    
    if(typeof data.root == "undefined") {
    	data.root = "rows";
    }
    
    if(typeof data.cache == "undefined") {
    	data.cache = false;
    }
    
    if(typeof data.addrow == "undefined") {
    	data.addrow = function (rowid, rowdata, position, commit) {
    		// synchronize with the server - send insert command
    		// call commit with parameter true if the synchronization with the server is successful 
    		//and with parameter false if the synchronization failed.
    		// you can pass additional argument to the commit callback which represents the new ID if it is generated from a DB.
    		commit(true);
    	};
    }
    
    if(typeof data.updaterow == "undefined") {
    	data.updaterow = function (rowid, newdata, commit) {
    		// synchronize with the server - send insert command
    		// call commit with parameter true if the synchronization with the server is successful 
    		//and with parameter false if the synchronization failed.
    		// you can pass additional argument to the commit callback which represents the new ID if it is generated from a DB.
    		commit(true);
    	};
    }
    
    if(typeof data.deleterow == "undefined") {
    	data.deleterow = function (rowid, commit) {
    		// synchronize with the server - send delete command
    		// call commit with parameter true if the synchronization with the server is successful 
    		//and with parameter false if the synchronization failed.
    		commit(true);
    	};
    }
    
    options.source = new $.jqx.dataAdapter(data, {
    	loadError: function(xhr, status, error) {
    		console.log("Error 	: " + error);
    	}
    });
    
    $("#'.$this->selector.'").jqxGrid(options);
    
    
    in reply to: Hide Button For Certain Row Hide Button For Certain Row #54894

    C.S.Putera
    Participant

    Okay, tq for the support.

    in reply to: Hide Button For Certain Row Hide Button For Certain Row #54876

    C.S.Putera
    Participant

    Thank you for the reply. Is there any solution on how I could hide the button ? Based on my code above, my code will check if the row’s ID is allowed to be accessed and if not, then hide button. Please help, tq

    in reply to: Hide Button For Certain Row Hide Button For Certain Row #54873

    C.S.Putera
    Participant

    I think I figure out why it shows error “too much recursion”. When I setcellvalue, it will trigger the function cellsrenderer again, right ? Is there a way that I could set the cell value to null or empty without triggering the cellsrenderer ? Please help, tq

    in reply to: Hide Button For Certain Row Hide Button For Certain Row #54871

    C.S.Putera
    Participant

    This is what I’ve come up with so far. I use ‘cellsrenderer’ like this :

    
    function (rowIndex, dataField, value, defaultHtml) {
     var rowData = $("#jqxgrid").jqxGrid("getrowdata", rowIndex);
     var isAccessable = false;
     // I've defined accessableIds before
     for(var prop in accessableIds) {
      if(accessableIds.hasOwnProperty(prop)) {
       if(accessableIds[prop] === rowData.id)
         isAccessable = true;
      }
     }
     if(isAccessable) 
      return "View";
     else
      $("#jqxgrid").jqxGrid("setcellvalue", rowIndex, dataField, "No Value");
    }
    

    But it shows error in console : “too much recursion”.

    Am I missing anything ? Please help, tq

    in reply to: Auto refresh grid Auto refresh grid #52622

    C.S.Putera
    Participant

    I am sorry, I cannot show you my code because my code is not written in javascript, I have written a Yii Framework extension for JqWidgets and therefore my code is PHP, meaning I pass the params, functions, etc in PHP. I also use full AJAX and therefore I cannot do “right click view page source” and show you the generated source code.

    Have you take a look at this example ? Pop Up Dialog

    If you see the source code on line 115, there is a line :

    
    $("#Save").click(function () {
    ...
    

    Now if you want to refresh the grid when the user press the save button, then you could just add :

    
    $("#Save").click(function () {
    ...
    $("#jqxGrid").jqxGrid("updatebounddata");
    ...
    

    Or if you want to refresh the grid on window close then you could just add :

    
    $('#jqxWindow').on('close', function (event) { 
       $("#jqxGrid").jqxGrid("updatebounddata");
    });
    

    Hope that helps

    in reply to: Set Grid Button Static ID Set Grid Button Static ID #52609

    C.S.Putera
    Participant

    Okay. Thank you Dimitar for the answer.
    But can I retrieve the generated ID ? On buttonclick I call :

    alert($(this).attr("id"));

    But it shows empty string. If I cannot set the ID before hand, perhaps I could set the ID after it is generated ?

    in reply to: Auto refresh grid Auto refresh grid #52606

    C.S.Putera
    Participant

    Hello. I am using pop up to input data to the grid also and I bind the event on windows closed and refresh the grid using :

    
    ...
    $("#jqxGrid").jqxGrid("updatebounddata");
    ...
    
    in reply to: Submit Grid Data On Form Submit Submit Grid Data On Form Submit #33129

    C.S.Putera
    Participant

    Sorry, forgot 1 thing. And I also need the user to be able to change the grid column value, so that in controller I could save the value input by the users. How can I do that ? Please help, thank you

    in reply to: getrowdata of hidden column getrowdata of hidden column #32699

    C.S.Putera
    Participant

    Thank you for the fast response. Nope, it has its value. I found the problem, it was my mistake, I did not assign the value, because I use method “addrow” for the grid rows, and did not set the delivery_confirmation_id. Thanks once again


    C.S.Putera
    Participant

    Thank you Mariya, that’s exactly what I needed


    C.S.Putera
    Participant

    Hello. I’ve got the solution of how to retrieve the id of the selected row. But now how to set the row as selected when I load the box data ? “selectrow” would not be appropriate since I do not know the index of the row, nor how to pass the id of the saved row to set the row as checked on page load. Please help. Thank you


    C.S.Putera
    Participant

    OMG, you are right. I checked the “view page source” on my chrome and the file is still pointing to the old file.
    I cleared the cache and it works well. Thank you

    But I haven’t got solution of how to retrieve the id of the selected row. I found method ‘.on(“rowselect”)’ :

    $("#gridId").on("rowselect", function(e){
    alert(e.args.rowindex);
    });

    But it only retrieve the index of the row which is not what I need. Could you please tell me how to retrieve the id ? Thank you

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