an electronic device includes a chassis and a tray installed in the chassis . the tray includes a base plate which defines an opening . a limiting standoff protrudes from an inner surface of the chassis and extends through the opening of the base plate . a locking module includes a pivotable member pivotally attached to the base plate which rotates about an axis perpendicular to the base plate . when the pivotable member is rotated to a first position , the limiting standoff locks the pivotable member to prevent the tray from sliding out from the chassis . when the pivotable member is rotated to a second position , the limiting standoff unlocks the pivotable member to allow the tray sliding out from the chassis .