librelist archives

« back to archive

How good support?

How good support?

From:
Eddie Shipman
Date:
2012-12-04 @ 21:58
Just checking to see if you actually answer questions about your library.

Eddie

Re: [jsonselect] How good support?

From:
Lloyd Trevor Hilaiel
Date:
2012-12-05 @ 00:16
Yes

-- lloyd (thumb-typing)

On Dec 4, 2012, at 2:58 PM, Eddie Shipman <eshipman@scic.com> wrote:

> Just checking to see if you actually answer questions about your library.
> 
> Eddie

Re: [jsonselect] How good support?

From:
Eddie Shipman
Date:
2012-12-05 @ 15:20
I posted this on stackoverflow.com but have received no replies.
I have the following JSON:
{
   "PID":"1234",
   "c_InfoCol":[
      {
         "c_State":"AL", "c_LicLabel":"Lic", "c_TypeCol":[
            {
               "LicType":null,
               "c_SubTypeCol":[
                  { "c_TypeID":"1", "Description":"AL", "Hours":5.0, 
"Units":5.0, "Price":5.0, "c_Exclusive":0.0},
                  { "c_TypeID":"2", "Description":"AL", "Hours":3.0, 
"Units":3.0, "Price":3.0, "c_Exclusive":0.0}
               ]
            }
         ]
      },
      {
         "c_State":"CT",
         "c_LicLabel":"Lic",
         "c_TypeCol":[
            {
               "LicType":"LH Lic",
               "c_SubTypeCol":[
                  { "c_TypeID":"3", "Description":"CT", "Hours":7.0, 
"Units":1.0, "Price":3.8, "c_Exclusive":0.0},
                  { "c_TypeID":"4", "Description":"CT", "Hours":1.0, 
"Units":1.0, "Price":3.8, "c_Exclusive":0.0}
               ]
            },
            {
               "LicType":"PC Lic",
               "c_SubTypeCol":[
                  { "c_TypeID":"5", "Description":"CT", "Hours":7.0, 
"Units":1.0, "Price":3.8, "c_Exclusive":0.0},
                  { "c_TypeID":"6", "Description":"CT", "Hours":1.0, 
"Units":1.0, "Price":3.8, "c_Exclusive":0.0}
               ]
            }
         ]
      }
   ]
}
In trying to use this code:
var StatesSelector = '.c_InfoCol :has(.c_TypeCol) .c_State'; 

try {
    var StatesListObj = JSONSelect.match(StatesSelector, window.data);
    $.each(StatesListObj, function(index, State) {
        // get the type ID(s) for this state
        TypeIDsSelector = '.c_InfoCol :has(.c_TypeCol .c_SubTypeCol 
.Description.val("'+State+'") > .nth-child(0))';
        TypeIDsObj = JSONSelect.match(TypeIDsSelector, 
window.data);                    
        value_ = "";
        $.each(TypeIDsObj, function(index, TypeID) {
            value_ += TypeID+',';
        });                 
        $("#data_select").append($("<option value='"+value_+"'>").html(State));
    });                 
} catch(e) { console.log(e); }
I keep getting the error: "multiple ids not allowed in 5"
Why would that be and what is causing this and am I actually using the 
correct selector?
I need to get the c_TypeID for the passed state_val to put into the value 
of the option.
Thanks so much